How to cancel local notification when an app is killed?

An example scenario:

  • I schedule a local notification to be sent out in 30 minutes when the player quits the game. 

  • The player kills the app 15 minutes before the notification is sent for whatever reason.

  • The player launch the app again at 20 minutes. 

  • How do I cancel the local notification? Is there anyway at all?

Thanks

You can cancel ALL the notifications using system.cancelNotification

From the docs

 

notificationId (optional) A notification reference id returned by system.scheduleNotification(). If no id is passed, then all notifications are cancelled.  

How silly of me to miss that. That is really useful, thank you so much!

You can cancel ALL the notifications using system.cancelNotification

From the docs

 

notificationId (optional) A notification reference id returned by system.scheduleNotification(). If no id is passed, then all notifications are cancelled.  

How silly of me to miss that. That is really useful, thank you so much!