2
Quelqu'un l'a utilisé pour annuler une notification locale planifiée? Je le vois dans la documentation mais je n'arrive pas à le brancher dans le code.Monotouch - CancelLocalNotification
UIApplication.SharedApplication.ScheduledLocalNotifications schedNoteList = new
UIApplication.SharedApplication.ScheduledLocalNotifications();
foreach(UILocalNotification sNote in schedNoteList)
{
if(sNote.FireDate == oldDate)
{
//Cancel the Notification
UIApplication.CancelLocalNotification(sNote);
}
}
Merci, Rick
Fonctionne bien sauf que vous devez convertir le FireDate en DateTime ou l'autre date en NSDate. Et la date de comparaison à UTC - Alors j'ai dû comparer les valeurs de chaîne pour le faire fonctionner ... Je ne sais pas pourquoi c'était - si (NSDateToDateTime (sNote.FireDate) .ToString() == oldDate.ToUniversalTime(). ToString()) – Rick