Rectangle 27 3

Is this a problem just when you're using the default broadcast - rather than a named - channel?

We have a fix for a problem with the broadcast channel on Android ready to be deployed tomorrow or early next week - it will be in platform version v1.4.27.

Thank you for your reply. I will test with a named channel and get back with the results.

Yes, I can now confirm that when I started to use a named channel the notification does indeed reach the phone. Thank you for your assistance and I look forward to the update!

@James Brady i m still failed to send push notifcation to the user using parse.com but failed to recieve notification in device

@roshammar i m still failed to send push notifcation to the user using parse.com but failed to recieve notification in device is this parse.com issue ?

Cannot receive push notifications in Android with trigger.io and parse...

android push-notification trigger.io parse.com
Rectangle 27 1

I have found the reason.

It is the "uri" field inside JSON.

As long as this field is included (with or without the content), notifications seemed being ignored by Parse, although you'll get a non-error callback.

According to the reply from Parse.com, this is an intended feature, so the notifications with "uri" field will be discarded on the server side, thus it will not be sent.

Any updates? I still get the same problem

@ss1271 can u pls tell me what i m doing wrong i m still failed to send notification to user stackoverflow.com/questions/30303082/

Android Parse.com push notification not sent - Stack Overflow

android parse.com push-notification
Rectangle 27 1

If you have just created the App in Parse and integrated in your App, It generally not works immediately Same thing happened to me. I was not getting the data, but after some time I got the requests when I saw the Parse Dashboard

It will take Approx 20 mins. You can try to see the Parse Analytics.(if you have implemented it) if Parse shows Requests in your Analytics Dashboard then It will work completely fine

parse.com - Cannot receive Parse push notifications on Android - Stack...

android parse.com push-notification
Rectangle 27 1

here is the manifiest file.....

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="your package name"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="15"
            android:targetSdkVersion="16" />

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <uses-permission android:name="android.permission.VIBRATE" />

        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="your package name.YourActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

            <service android:name="com.parse.PushService" />

            <receiver android:name="com.parse.ParseBroadcastReceiver" >
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />
                    <action android:name="android.intent.action.USER_PRESENT" />
                </intent-filter>
            </receiver>
            <receiver android:name="your package name.YourCustomReceiver" >
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.USER_PRESENT" />
                    <action android:name="your package name.UPDATE_STATUS" />
                </intent-filter>
            </receiver>
        </application>

    </manifest>
public class MyCustomReceiver extends BroadcastReceiver {
@Override
    public void onReceive(Context context, Intent intent) {

        Bundle extras = intent.getExtras();

        String message = extras != null ? extras.getString("com.parse.Data")
                : "";

        Log.e("message ", " " + message);

        JSONObject jObject;
        try {
            if (message != null && !message.equals("")) {
                jObject = new JSONObject(message);

                from = jObject.getString("from");
                msg = jObject.getString("title");
                title = jObject.getString("msg");



                GCMMessage gcmMessage = new GCMMessage();
                gcmMessage.setMsg_body(msg);
                gcmMessage.setMsg_title(title);
                gcmMessage.setType(0);
                gcmMessage.setDateTime(time);



                DatabaseUtil.insertMessage(context, gcmMessage);
            }

        }

        catch (JSONException e) {
            e.printStackTrace();
        }

    }

}
JSONObject obj;
            try {
                obj =new JSONObject();
                obj.put("alert","oman expert ");
                obj.put("action","Your Package name.UPDATE_STATUS");



data.put("from", ParseUser.getCurrentUser().getUsername());         


    obj.put("msg","hi");
    obj.put("title","msg");
                ParsePush push = new ParsePush();
                ParseQuery query = ParseInstallation.getQuery();



                push.setQuery(query);
                push.setData(obj);
                push.sendInBackground(); 
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

java - android Implement chatting through push notification using pars...

java android push-notification parse.com
Rectangle 27 8

Seems like you need this in the request JSON: "sound": "default". Blank used to work, but now needs "default" to use the default sound.

parse.com - No sound in Parse push notification for ios8 - Stack Overf...

push-notification parse.com ios8 audio
Rectangle 27 5

I use a service called Parse to do my notification pushes to both Android and iOS. They have great documentation and libraries available. You can get some details here: https://parse.com/products/push

Is there any way to do this without using a third party Service?

@Pixel Crunch Is Parse service for push free ? I referred its documentation. In that it was specified that for free account, you have 30 req/s. can you please explain this ?

Parse Push service is free within 1.000.000 unique recipients. parse.com/plans

@Pepster but i guess we can move Parse code to own server to continue service.

One server sending push notifications to Android and iOS devices - Sta...

android ios push-notification apple-push-notifications google-cloud-messaging
Rectangle 27 4

Parse.com - I've successfully pushed a notification to the Kindle Fire following their quick start guide. Very straight-forward. It's a tiered freemium model, i.e., free depending the volume. Pricing seems very reasonable, comparatively to Urban Airship and Xtify.

Xtify - Should also work, but I have yet to try it. It uses an XMPP connection to send messages. Also appears to be freemium, depending on the number of devices (currently says under 10K devices is free as a "developer special").

android - Push notifications / C2DM for Kindle Fire? - Stack Overflow

android android-c2dm kindle-fire push-notification
Rectangle 27 70

The way to register for push notifications has been changed in iOS 8: Below is the code for all versions till iOS 9:

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

}
else
{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

In case you want to check whether push notifications are enabled or not use below code:

- (BOOL) pushNotificationOnOrOff
{
    if ([UIApplication instancesRespondToSelector:@selector(isRegisteredForRemoteNotifications)]) {
        return ([[UIApplication sharedApplication] isRegisteredForRemoteNotifications]);
    } else {
        UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
        return (types & UIRemoteNotificationTypeAlert);
    }
}

#ifdef __IPHONE_8_0
- (void)application:(UIApplication *)application   didRegisterUserNotificationSettings:   (UIUserNotificationSettings *)notificationSettings
{
    //register to receive notifications
    [application registerForRemoteNotifications];
}

- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString   *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
{
    //handle the actions
    if ([identifier isEqualToString:@"declineAction"]){
    }
    else if ([identifier isEqualToString:@"answerAction"]){
    }
}
#endif

The check should really use respondsToSelector, not the OS version.

The answer could be wrong. in the 'else', it should be, UIRemoteNotificationTypeXXXXX instead of UIUserNotificationType****. UIUserNotificationType**** is not defined in earlier iOS'es and will crash the app.

well @karim its 100% tested code and its work great.. I couldn't understand how people can down vote the answers without testing themselves.So its better to test first before down voting someone's answer... And for your kind information my app is live and push notifications are working on iOS 8 and before versions too.

Well, you know UIUserNotificationTypeBadge and so on are defined iOS 8.0. So xcode 5 will have compiler error. However, since its a constant it will work runtime in the devices less than 8.0. Its better to use old constants, [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

The documentation says that you should only call registerForRemoteNotifications once didRegisterUserNotificationSettings is called

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 3

I highly suggest the Parse API. You can find it here: http://parse.com. Not only is it universal for Android devices, but is also cross platform for iOS, JavaScript, and REST as well. You can do simple text push messages, or complex ones that send a JSON string to the pushed device. I'm not exactly sure the scope you need for your app (you may need more server-side control, although Parse is now providing a way to run code in the cloud as well), but definitely check out Parse.

Second, Parse has been announced as shutting down, and will not be supported after January 28, 2017: Parse blog announcement

Third, to truly answer your question, there are indeed some alternatives to GCM and SNS that can provide what you need. Without going into detail or pros/cons for each approach, here are a few alternatives to get you researching:

  • Depending on your use case, periodical polling from the server (i.e. poll once a day to get a "feed" for the latest notifications.
  • Some type of MQTT protocol implementation

Thanks for the suggestion. Will check it out ....

But it seems their notifications don't work if you publish in the Amazon App Store.

Push notifications on Android: Google GCM vs. Amazon SNS? - Stack Over...

android push-notification android-c2dm google-cloud-messaging amazon-sns
Rectangle 27 2

There are some difference between servers in real APNs and test APNs . Push Notifications are not reliable. This is not your problem.

APNS is based on Apple Servers, and Apple doesn't give any guarantee on successful message delivery.

parse.com - Ios - Push notification not receiving sometimes using pars...

ios parse.com ios9
Rectangle 27 12

Add this line at the top of your .m file

#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

1) You have to put condition when you register for push notification in IOS8. add this code in application did finish launch.

if(IS_IOS_8_OR_LATER) {
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes: (UIRemoteNotificationTypeBadge
                                                                                         |UIRemoteNotificationTypeSound
                                                                                       |UIRemoteNotificationTypeAlert) categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
 } else {
    //register to receive notifications
    UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes];
 }
IOS8
#ifdef __IPHONE_8_0
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:   (UIUserNotificationSettings *)notificationSettings
{
    //register to receive notifications
    [application registerForRemoteNotifications];
}

- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString   *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
{
    //handle the actions
    if ([identifier isEqualToString:@"declineAction"]){
    }
    else if ([identifier isEqualToString:@"answerAction"]){
    }
}
#endif

Using this method only works if you distribute for one OS version only. If you set your base version to 7 and distribution target to 8, this will crash on iOS 7; if you set your distribution target to 7, it won't work on 8. The correct method is a runtime check, as in penkaj's answer (though that currently uses the wrong runtime check, see my comment on it).

yeah ok you can put if else condition then no issue. Thanx!!

I edited the code now it will work for ios7 as well and yeah you have to add those old delegate methods of remote notification for below IOS8 to get callback whenever any push arrives.

@Nits007ak, did you test push on real device ios 7?

@tesmojones yes I test its working fine...u need to add old delegate methods of remote notification didRegisterForRemoteNotificationsWithDeviceToken, didReceiveRemoteNotification for below IOS8

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 1

Because, Push Notification is not a reliable source. You can't ensure every time your push notification will sent. More see this

parse.com - Ios - Push notification not receiving sometimes using pars...

ios parse.com ios9
Rectangle 27 4

didReceiveRemoteNotification
  • The user is in the application when the notification is received, or
  • The user engages a notification after receiving it outside the app.
application.applicationState

You can tell whether your app was just brought to the foreground or not in application:didReceiveRemoteNotification: using this bit of code:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    if ( application.applicationState == UIApplicationStateActive )
        // app was already in the foreground
    else
        // app was just brought from background to foreground
    ...
}
UIApplicationStateInactive
UIApplicationState.Inactive

The app is running in the foreground but is not receiving events. This might happen as a result of an interruption or because the app is transitioning to or from the background. Source

UIApplicationState.Background
if application.applicationState == UIApplicationState.Background {
    PFAnalytics.trackAppOpenedWithRemoteNotificationPayloadInBackground(data, block:nil)
}

So, that solves the open from background issue, but what about when the user receives the notification in the app? You don't want the jarring popup, so the way to disable that is to get rid of its source, PFPush.handlePush().

All that handlePush: does is create that alert view and present it to the user, so removing it will not affect anything else:

A default handler for push notifications while the app is active that could be used to mimic the behavior of iOS push notifications while the app is backgrounded or not running.Source

If you want to increment the badge count, you still can:

if userInfo.objectForKey("badge") {
    let badgeNumber: Int = userInfo.objectForKey("badge").integerValue
    application.applicationIconBadgeNumber = badgeNumber
}

@TIMEX No problem; I'm glad I could help.

Do I ever need to check for notifications in application:didFinishLaunchingWithOptions ? The parse documentation says I need to deal with that as well.

@TIMEX Only if you want to configure what happens to the user after they open your app through the push notification. See parse.com/questions/ and parse.com/questions/.

if ( application.applicationState == UIApplicationStateActive )         // app was already in the foreground     else         // app was just brought from background to foreground

@TIMEX I believe you can do it either way.

ios - How an I prevent the UIAlertView from appearing when a push noti...

ios swift parse.com push-notification
Rectangle 27 4

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) {
    // For iOS 8

[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

 [[UIApplication sharedApplication] registerForRemoteNotifications];
} 

else 
{
    // For iOS < 8
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
  • Delete the apps who don't have Push notifications any more form the device.
  • Turn the device off completely and turn it back on.
  • Go to settings and set date and time ahead a day
  • Turn the device off again and turn it back
  • Install the apps again and It'll ask for notification like the first time you installed It.
  • Reset your date / time again if not automatically set.

This will reset the notification settings. Re install the app and all will work fine :)

Thank you! I was having problems with the notification prompt, this fixed it.

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 4

Runtime and old compiler safe options ... if you run in old xcode (5.0 or earlier)

// changes of API in iOS 8.0
- (void) registerForPushNotification
{
    NSLog(@"registerForPushNotification");
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
    {

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 //__IPHONE_8_0 is not defined in old xcode (==0). Then use 80000

        NSLog(@"registerForPushNotification: For iOS >= 8.0");

        [[UIApplication sharedApplication] registerUserNotificationSettings:
            [UIUserNotificationSettings settingsForTypes:
                (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
                                              categories:nil]];
        [[UIApplication sharedApplication] registerForRemoteNotifications];
#endif
    } else {
        NSLog(@"registerForPushNotification: For iOS < 8.0");
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
         (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
    }
}

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 2

This error is likely being returned because your where value does not match the REST API spec. You will also want to make sure you are consistent in your use of double quotes as these can also lead to malformed JSON errors (e.g. do not use and , use ").

After fixing that, we end up with the following, which is still not valid per the REST API Parse docs:

"where": {
  "$and": [ 
            {"deviceType": "winphone},
            {"channels": { 
               "$all": ["string1"],
               "$nin":["string2"]}
              }
          ]
},

There's a couple of problems with your query:

I have simillar problem, I need to send a message only to people, who subscribe channel1 and dont subscribe channel2. Why is this request bad: {"deviceType": "winphone", "channels": {"$all": ["channel1"],"$nin":["channel2"]}, "data": { "alert":"channel1, but no channel2"} }? Also this request is bad: {"where": {{"deviceType": "winphone"},{"channels": {"$all": ["channel1"],"$nin":["channel2"]}}},"data": { "alert": "channel1, but no channel2"} }. Why is that so and what can I do to make it work properly?

The troubleshooting guide in the Parse documentation is a great place to start whenever you run into issues with push. One of the most important tips laid out there is to actually make sure your push query matches the installations you intend it to. If the push query does not accept $all and $nin on the same key, then your push simply won't have the intended audience.

curl - Send advanced push notification in parse.com with Rest API - St...

rest curl parse.com
Rectangle 27 1

Try This if you have both iOS 8 and older versions:

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) {
    // For iOS 8
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
    // For iOS < 8
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

A UIUserNotificationSettings object encapsulates the types of notifications that can be displayed to the user by your app. Apps that use visible or audible alerts in conjunction with a local or push notification must register the types of alerts they employ. UIKit correlates the information you provide with the users preferences to determine what types of alerts your app is allowed to employ.

Use this class to encapsulate your initial registration request and to view the request results. After creating an instance of this class and specifying your preferred settings, call the registerUserNotificationSettings: method of the UIApplication class to register those settings. After checking your request against the user preferences, the app delivers the results to the application:didRegisterUserNotificationSettings: method of its app delegate. The object passed to that method specifies the types of notifications that your app is allowed to use.

In addition to registering your apps alert types, you can also use this class to register groups of custom actions to display in conjunction with local or push notifications. Custom actions represent immediate tasks your app can perform in response to the notification. You define groups of actions and associate the entire group with a given notification. When the corresponding alert is displayed, the system adds buttons for each action you specified. When the user taps the button for one of the actions, the system wakes your app and calls the application:handleActionWithIdentifier:forRemoteNotification:completionHandler: or application:handleActionWithIdentifier:forLocalNotification:completionHandler: method of its app delegate. Use those methods to perform the requested action.

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 1

Its very simple:

didFinishLaunchingWithOptions
xcode6
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
 [[UIApplication sharedApplication] registerForRemoteNotifications];

iphone - iOS 8 enabled device not receiving PUSH notifications after c...

ios iphone notifications parse.com push
Rectangle 27 0

here is the manifiest file.....

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="your package name"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="15"
            android:targetSdkVersion="16" />

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <uses-permission android:name="android.permission.VIBRATE" />

        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="your package name.YourActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

            <service android:name="com.parse.PushService" />

            <receiver android:name="com.parse.ParseBroadcastReceiver" >
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />
                    <action android:name="android.intent.action.USER_PRESENT" />
                </intent-filter>
            </receiver>
            <receiver android:name="your package name.YourCustomReceiver" >
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.USER_PRESENT" />
                    <action android:name="your package name.UPDATE_STATUS" />
                </intent-filter>
            </receiver>
        </application>

    </manifest>

android - Cannot receive push notification from parse.com while app is...

android parsing push-notification parse.com
Rectangle 27 0

EDIT: Since Receiver is an inner class, it cannot exist outside of an instance of its outer class. This is why you cannot instantiate it via the manifest definition. To solve, mark Receiver as static, or define it as its own class file. (You can probably remove the empty constructor I had previously advised).

You need a constructor so the receiver can be instantiated:

public Receiver(){

}

Ive implemented it as suggested ( see edited question) and still the same error is being thrown.

Ill mark this answer as correct, but i am now getting a new error.

java - Error associated with receiving parse.com push notification And...

java android parse.com push-notification