Silent Push Notifications No Longer Work in iOS 10

I use push notifications to tell my app to download new content from the server with content-available:1 in the push payload. This has been working fine, but then I noticed that it no longer works on devices running iOS 10. I just tested it again on an iPad 2 running iOS 9 and it works fine there, but not on any of my iOS 10 devices.


I've also tried implementing the new UserNotifications framework, but it won't work there either. The delegate method never gets called though it gets called when I send a non-silent push.


Regular push notifications with a message, badge, and sound all work fine so do I need to submit a radar for silent push not working?


-Matt

I have the same problem.


Did you get any solution to this?

Did you guys sort it out? It does work for me when the app is active (foregorund or background), but it looks like silent notifications do not launch the app anymore after, for istance, a device restart. This is new as in iOS9 the only limitation of silent push was they would not launch the app if the latter had been explicitely killed by the user.

I tried the old way and the new way(UserNotifications framework) as well, and cannot get consistency. Works 100% only when apps in the foreground. Its frusturating that Apple does not have any specific docs on how this works, other than stating to send a max of 1 to 2 pushes per hour. Pushes fail even if I send 1 or 2 per hour.

Saw this same issue, Push Notifications stopped working on iOS10 using our own Parse Server, thus our Tokens seemed to expire after 2 to 3 days. We actually saw a development client not receiving any Push Notifications, and noted the token it sends up to Parse, and Parse would then use this very Token only to get a failed message from Apples APNS saying the Token wasn't valid. Thus Apple's APNS set us an expired Token. Once the tokens expire only thing the client can do to reactivate them was to delete the client and reinstall it, then they would work for another 2 to 3 days. Needless to say this really ****** off your users.


We then switched to this code (shown below) on the iOS client in the AppDelegate to register for Push Notifications and the problem seemed to mysteriously disappear thereafter, but we also made changes on our Parse Server to not send any more Push Notifications with expired Tokens and I think that actually fixed it. We also used the UNUserNotificationCenterDelegate in our AppDelegate along with its delegate methods. We also deleted all our expired Push Notification Certificates on our Portal, in addition we also updated our iOS Provisioning Profile and pointed Xcode's Main Target to this Certificate in the Provisioning Profile (Deprecated) key . My guess is Apple's APNS when it gets a bunch of expired Tokens to send Push Notifications out on decides for whatever reason to expire the current active Token which it should never do. We called Apple on this, and generated a formal TSI event, but their help was minimal at best, but they did confirm that you should not generate Push Notifications with expired Tokens, and if you do APNS might retire a Token. Once Apple hears your using Parse, they don't want to help, at all, and I imagine half the world is using the open source version of Parse to generate their push notifications. We also stopped supporting iOS8, and only support iOS9 and iOS10 now.


#define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

- (void)registerForRemoteNotification

{

if(SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(@"10.0"))

{

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];

center.delegate = self;

[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){

if( !error ){

[[UIApplication sharedApplication] registerForRemoteNotifications];

}

}];

}

else

{

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

[[UIApplication sharedApplication] registerForRemoteNotifications];

}

}


#pragma mark - UNUserNotificationCenter Delegate

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{

[self application:[UIApplication sharedApplication] processRemoteNotification:notification.request.content.userInfo];

//We set this for UNNotificationPresentationOptionNone since we have our own internal notification banner

completionHandler(UNNotificationPresentationOptionNone);

}

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler{

/

[self application:[UIApplication sharedApplication] processRemoteNotification:response.notification.request.content.userInfo];

completionHandler();

}


- (void)application:(UIApplication *)application processRemoteNotification:(NSDictionary *)userInfo

{

//Process your Push Notification here


}

Hi All,


I have same issue in my application. Anybody got the solution?


Regards,

Nagraj Wadgire

всем привет! 🙂 hi everybody, check your payload format, it should be just like in the documentation:

{

"aps" : {

"content-available" : 1

},

"acme1" : "bar",

"acme2" : 42

}

1 should be not string, but integer, "1" worked for ios9, but not 10. same for ios application didReceiveRemoteNotification part:

let aps = userInfo["aps"] as! [String: AnyObject]

if aps["content-available"] as? Int == 1{

// do something

}



same issue...
in ios 10 it does not works.

We are also facing the same issue.

Did any one find any solution .

Silent push notifications work fine with development environment on iOS 10 for me. I suggest trying to identify where the trouble might be occurring.


1) when the device registers with the APNs service and receives the response (iOS code)

2) when the device sends this device token to your provider server (iOS/web server)

3) when the provider server sends the HTTP2 request to the APNs server (web server)

4) the response from the APNs server ( success/failure/no response) (web server)

5) whether the APNs delivers remote notifications to the device (iOS)


I hope this will help you and others troubleshoot your issues.

Silent Push Notifications No Longer Work in iOS 10
 
 
Q