App lost control over local notifications after being updated from App Store

后端 未结 4 1286
忘了有多久
忘了有多久 2021-01-03 23:39

I have an app with local notification at the App Store.

In the last 4 version updates to my app, there were customers who experienced something strange - the app lo

4条回答
  •  孤独总比滥情好
    2021-01-04 00:00

    Add the following code to your application:didFinishLaunchingWithOptions: method to clear all the notification.

     [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 1];
     [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];
     [[UIApplication sharedApplication] cancelAllLocalNotifications];
    

    Once done you can add the new notifications.

提交回复
热议问题