cancelAllLocalNotifications in applicationWillTerminate?

前端 未结 2 1433
温柔的废话
温柔的废话 2021-01-14 20:36

I want to cancelAllLocalNotifications and setApplicationIconBadgeNumber to 0 when my application is terminated (either by the OS or by double tapping the home button and kil

2条回答
  •  鱼传尺愫
    2021-01-14 20:57

    applicationWillTerminate: is not called by the OS when it kills your app. The OS just kills the process without notifying your app about it. There is no documented way to execute code at this moment.

提交回复
热议问题