In iOS 8, even without user's explicit permission, remote notifications can be sent to user's device. So I'm trying to use this and remote-notification background mode to wake up the app by sending remote push notifications.
I confirmed that this works by registering for remote notification only and not for user notifications. (-registerUserNotificationSettings)
[application registerForRemoteNotification];
I have implemented the following delegate method.
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
However, it seems like it only works when the app is in foreground.
According to the doc,
Use this method to process incoming remote notifications for your app. Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background.
Even though I have remote-notification background mode enabled ("Required background modes" has "App downloads content in response to push notifications" from the Info of the project setting), it won't wake up the app.
Am I missing something here?
Just to be clear, I don't want users to see the push notification permission alert because I don't need to show anything when push notification is received. I'm just trying to wake up the app and do some processing.
This is the payload I'm using.
{ "aps": { "content-available": 1 } }
From console, I see this.
apsd[82] <Warning>: Silent Push: Deny app has no feature.