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:
- We use SNS to send visual/audible and silent background notifications.
- We are aware of the apns-push-type header that is required for ios13. SNS automatically handles this new header and our manual testing (i.e. without SNS) have also produced the same results.
- The silent notifications (i.e. content-available: 1) always fail on ios13.3 (or higher) but always work on ios12.4 (and below).
- In our swift code, we are using :didReceiveRemoteNotification:fetchCompletionHandler for silent notifications. We are also using userNotificationCenter (with willPresent and didReceive). Whenever we send audible/visual notifications, willPresent gets triggered on ios12 and ios13. On ios12, silent notifications trigger didReceiveRemoteNotification:fetchCompletionHandler but nothing with ios13.
- During our testing, we successfully sent an empty alert type to trigger a silent notification on ios13 and this works on ios12 as well (this triggers willPresent). This feels like a hack to me because it will likely wakeup the device momentarily and the notification will disappear if the app is running in the background.
- In other viewcontrollers, we are observing NotificationCenter for received messages to take appropriate actions.
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.