applicationDidReceiveRemoteNotification not called on iPhone 7 on background

Viewed 113

I want to set a local notification when a remote notification is received and app is in background. This works fine when I have my iPhone 7 device connected to xcode but once I disconnect the device and then put the app in background, local notification does not work and this is because applicationDidReceiveRemoteNotification is not being invoked (I tested it by setting a flag in UserDefaults in the same method which again was not being set). This same procedure when followed on iPhone 6 and 6s works completely fine both when connected and when not connected to xcode. The iOS version on iPhone 7 was 10.2.1 and then updated to 10.3.1 and it didn't work on both of the versions. Thanks.

1 Answers
Related