Repeating a Local Notification after every 14 days(two weeks)?

后端 未结 3 2007
囚心锁ツ
囚心锁ツ 2020-12-17 01:43

In my app i\'ve to set repetitive UILocalNotification. I\'m able to set repeatInterval as daily, weekly etc by doing

UILocalNotification *localN         


        
3条回答
  •  清歌不尽
    2020-12-17 02:12

    You can cancel the notification and set a new one fire date at 14 days from now when handling the notification. i.e. when your app is running in the foreground, do it in:

    (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
    

    See this SO topic: Set repeatInterval in local notification

    I've tried this way, and it works.

提交回复
热议问题