iOS stops launching my Xamarin.iOS app to process incoming push notifications
I have a Xamarin.iOS app that registers with an Azure notification hub to receive push notification. When the app is running in the foreground or inactive, but showing in the task manager, notifications are received, processed and stored. When the app is not running and has been removed from the task manager, iOS will launch the app and fire the DidReceiveNotification event so the notification can be processed and stored in the app’s database.
Unfortunately, after an hour or so, iOS will receive an incoming notification, which appears on the lock screen, but my logging shows it no longer launches the app to process and store the notification. Anyone have an idea why?
I am using the following for this app:
• Visual Studio 2019 16.9.4
• Xamarin.Forms 5.0.2012
• Xamarin.Essentials 1.6.1
• Xamarin.Azure.NotificationHubs.iOS 3.1.1
• Physical iPhone 11 Pro running iOS 14.5
• Push Notifications Capability checked in the App Identifier on the Apple Developer site
• Enable Background Modes and Remote Notifications capabilities are enabled in the Info.plist