Reputation: 175
I am running into a really weird problem where I can't quite nail down the root cause. Our app used to function properly for background/silent notifications for ios12 and ios13 up until a few weeks ago. So a bit of background information:
To me it seems, {"content-available": 1} never works on ios13 and but does on ios12. Also didReceiveRemoteNotification:fetchCompletionHandler never gets called on ios13 but does on ios12. Our intent with silent notifications with (i.e. with content-available:1) is to refresh the details from our service when changes occur when the app is in foreground or background.
Any help would be appreciated.
Upvotes: 1
Views: 843
Reputation: 175
I was able to resolve this issue. Before I get into the solution, however, I want to mention that I ran into this problem only on iOS13 and with silent notifications. The same code was working with iOS12 with same feature.
Our app has a separate screen for requesting notification permissions when the app is launched first time. At this stage we register the device for notifications. Next time when the app is launched, we don't show this screen anymore. To get it to work on ios13, we had to re-register with APNS in AppDelegate's didFinishLaunchingWithOptions every single time. Again, on iOS12 silent notifications were working without re-registering with APNS but on iOS13 we have to re-register every single time.
I hope this helps anyone else running into this problem.
Upvotes: 0