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

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

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

iOS – Ask to enable push notifications after initial decline

You can’t make iOS show the alert again. Here’s a better approach: Keep a flag in your NSUserDefaults indicating whether you should register for push notifications at launch. By default the flag is false. When you launch, check the flag. If it’s true, register immediately. Otherwise, don’t register. The first time the user does something … Read more

Xcode 8 APS Environment Entitlement won’t set to production

Turn off the “push notifications” in Capabilities then re-build. Update After hours of debugging, no matter how you configure Xcode8 or build with whatever scheme(debug or production), you will always get a deviceToken for development environment from APNS. I tried to remove my app on my test device which build directly from Xcode8.1 with production … Read more

Which Apple Push Notification Service Java library should I use? [closed]

If anybody else is looking for an APNs library in Java, we at RelayRides just released Pushy (http://relayrides.github.io/pushy/). It does some things differently than the other two contenders (like async network IO), so it can send large numbers of messages really quickly. We actually use it in production, too, so it’s actively maintained by our … Read more

Detect if application: didReceiveRemoteNotification: fetchCompletionHandler: was called by tapping on a notification in Notification Center

The Apple docs are a bit confusing application: didReceiveRemoteNotification: fetchCompletionHandler: is used if your application supports the remote-notification background mode (ie you’re doing BackgroundFetch.) application: didReceiveRemoteNotification: is called when the OS receives a RemoteNotification and the app is running (in the background/suspended or in the foreground.) You can check the UIApplicationState to see if the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)