AppDelegate methods not called on iOS 10 GM

I have troubles determining when the user taps on a user push notification on iOS 10.



So far, I have been using the `-[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]` which is called when


- Case 1: the application is active and the push is received

- Case 2: when the user launched the app after taping a received notification



This method comments explicitly say


Note that this behavior is in contrast to application:didReceiveRemoteNotification:, which is not called in those cases, and which will not be invoked if this method is implemented.


All this work as expected.


Now iOS 10 deprecated this delegate method and introduced the `UserNotification` framework which I cannot use because I'm still targeting iOS 8 and 9.



When my app is running on iOS 10 and a push is received while the app is active (`Case 1`), the `-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]` is called correctly.


However, when the user starts the app by tapping a notification (Case 2) this method **is not called**.



I realise that when I implement the older `-[UIApplicationDelegate application:didReceiveRemoteNotification:]` it is the one that gets called in the Case 2



On iOS 8 and 9, in the Case 2 it is the `-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:]` method is called.



Does it mean that I have to update my application and implement the older delegate just for iOS 10? This callback is by the way marked as deprecated on iOS 10 :/



So the question is, what is the proper implementation of handling the user interaction of a received push on iOS 10 without using the `UserNotification` framework.





cheers,

Tex

Replies

I wish I could help. I am having the same issue with iOS 10 and -[UIApplicationDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] not being called when the user taps a push notification. As iOS 10 is releasing soon, I'm at a loss as to how I can fix this.

Having the same issue as you and yes I did that workaround too. Also having issues with custom sounds not working that used to as well

I am also facing the same issue. I have to do some processing once the user taps notification and open the app. Now looks like [AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] doesnt gets called when app is in background. I am also confused. I am still at iOS9SDK and my project is not ready yet to move to iOS10 SDK.

I also can't get UILocalNotifcations to use their custom sounds on iOS 10.