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

后端 未结 4 1277
忘了有多久
忘了有多久 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-03 23:49

    Hey that is what is also happening with my app as well. My local notifications are getting fired in below scenerios :
    1. user has deleted the app

    1. Using same app on same device but with different user name, they getting alerts for last logged in user.

    -Actually its UILocalNotification behave, we have to cancel them else IOS retain them for at least some time(not sure how long) when app is deleted and they were scheduled by the app at deletion time and were not canceled.

    So always make sure when ever your app install happens,keep a check & cancel all scheduled notifications.

    like

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    
        if(//its a fresh install){
    
         [[UIApplication sharedApplication] cancelAllLocalNotifications];
    
        }
    
    
        }
    

    cancelAllLocalNotifications will cancel all existing notifications.

    Hope it will help.

提交回复
热议问题