Receiving Push Notifications while in background

application:didReceiveRemoteNotification: will call in the background only when you have added content-available key with value 1 into the notification payload. In case of the Urban Airship, you can send Test Push under the Setting tab. Sample Payload for Push Notifications: { “aps”: { “alert”: “aaaa”, “badge”: “+1”, “content-available”: “1” }, “device_tokens”: [ “86BA71E361B849E8312A7B943BA6B26A74AB436381CF3FEE3CD9EB436A12A292” ] } … Read more

push notification handling

The wording here is confusing, especially around the word backgrounding. When the application is truly not loaded in memory (e,g. when you launch it the splash screen shows up etc), then application:didFinishLaunchingWithOptions is called, and you can get the push notification as follows: NSDictionary *remoteNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; if(remoteNotif) { //Handle remote notification } If … Read more

Android app – detect if app push notification is off

You can check if the user is allowing notifications for your application with this command: NotificationManagerCompat.from(context).areNotificationsEnabled() This one-liner works from API level 19+. However, starting with android O, notification channels are introduced. This allows the user to disable only particular notification channels from the application settings screen and also disable all notifications from the app. … Read more

global leak errors in mocha

Yes, Mocha features a global leak detection mechanism which alerts and fails if your code under test introduces global variables. If hasCert is declared in a library and you have no control over its creation, you can tell Mocha to ignore it. On the command line, $ mocha –globals hasCert To quote the documentation: [This … Read more

How to send a silent Push Notification payload

There are a few options for it! Let’s take a small ride to understand all the different payloads and their usage. Simple Payload Displayed in Notification Center : Yes Wakes app to perform background task : No { “aps” : { “alert” : “You received simple notification!”, “badge” : 1, “sound” : “default” } } … Read more

Exception when opening Parse push notification [closed]

After spending few hours. Found a solution: Implement your receiver and extends ParsePushBroadcastReceiver class. Receiver.java public class Receiver extends ParsePushBroadcastReceiver { @Override public void onPushOpen(Context context, Intent intent) { Log.e(“Push”, “Clicked”); Intent i = new Intent(context, HomeActivity.class); i.putExtras(intent.getExtras()); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } } Use it in manifest, (Instead of using ParsePushBroadcastReceiver) Code for project’s manifest: <receiver … Read more

What is the difference between Push API and Server Sent Events?

The Push API allows the server to send a notification to a client even when your site is not open, because it relies on service workers. SSE (or WebSockets) work as long as the user is using your site. There are some examples (with documentation) in the Web Push section of the ServiceWorker Cookbook that … Read more

Implementing Push notifications for iOS (Server Side)

Have a look at easyAPNS if you want to host it yourself, or visit Urban Airship if you are ok with a hosting service (they have an extensive set of documentation) Another good site for info is Ray Wenderlich’s site which hosts a 2 part tutorial: Apple Push Notification Services Tutorial: Part 1/2 Apple Push … Read more