saturdaymp/XPlugins.Notifications

Add Ability to Cancel Notifications

mrbiggred opened this issue · 1 comments

Now that we can create notifications it would be nice to cancel them. The cancel signature should look like:

notificationScheduler.Cancel(notificationNumber)

Currently I don't have any plans for this method to return anything or raise any errors. If the notification exists then we will assume it will always be cancelled. If the notification does not exist then it's technically already cancelled.

To cancel a notification in iOS 9 you need to add a unique identifier to notification. Then loop over the notifications looking for the unique identifier and cancel it. See the following for a object-c example:

http://stackoverflow.com/questions/6340664/delete-a-particular-local-notification

For Android cancelling the notification can be accomplished by using the NotificationManager.Close method.

You can now cancel notifications. Also added the find method.