0

I have some logic within my app delegate on iOS for handling incrementing a push notification badge - but have had intermittent behaviour with this for some users.

The app is registered for background remote notifications.

Visual Studio Settings

Notifications are received fine when app is in foreground, background or phone is restarted.

A few different scenarios occur:

  1. Foreground - notification & badge.
  2. Background - notification & badge.
  3. App Killed - notification & badge sometimes
  4. Device Restart - notification & no badge.

My question is - does App Delegate code run when an iOS app is killed by the user (for a period of time -i.e until another app takes up that space in RAM) and does App Delegate code not run at all if the device is restarted?

Raymond Dillon
  • 197
  • 1
  • 18
  • 1
    https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/backgrounding/application-lifecycle-demo – Jason Nov 09 '22 at 23:27
  • Also see [Using background tasks](https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/using_background_tasks_to_update_your_app). – ToolmakerSteve Nov 10 '22 at 02:32
  • Please take a look at this [so question](https://stackoverflow.com/questions/14256643/update-badge-with-push-notification-while-app-in-background/53159748#53159748). It may help you with badge count. – Liqun Shen-MSFT Nov 10 '22 at 08:32

0 Answers0