7

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.
Todd
  • 239
  • 2
  • 11
  • 1
    It started to work after I re-did everything from scratch. Probably my APN certificate or provisioning profile setup wasn't correct. What's interesting was even in that case it was working when the app was running in foreground which made me really confused. I went back and did everything carefully step by step and it worked after that. – Todd Sep 27 '14 at 06:32
  • 1
    See http://stackoverflow.com/a/19202487/536308 that indicates it won't work if your kill your app and don't relaunch it. You'll need to restart the device to make push received and your app opened. – ıɾuǝʞ Oct 20 '14 at 15:30
  • 1
    @Todd I'm running into the same situation, sans your 'Silent Push:' warning. Can you share what you followed step-by-step. An apple doc or maybe some 3rd party tutorial? Thanks. – Chad Podoski Nov 21 '14 at 03:34
  • re the comment above from Oct 20 '14 at 15:30 .. this refers to iOS8 and that thread is for iOS7.. so the caveat mentioned does not apply. – drew.. Apr 21 '15 at 03:46

0 Answers0