Procházet zdrojové kódy

Replacing a notification with the same ID may result into canceling both (Fix for #135)

Sebastián Katzer před 11 roky
rodič
revize
282875db13
2 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 5 0
      CHANGELOG.md
  2. 4 1
      src/ios/APPLocalNotification.m

+ 5 - 0
CHANGELOG.md

@@ -1,4 +1,9 @@
 ## ChangeLog
+#### Version 0.7.4 (not yet released)
+- [bugfix:] Platform specific properties were ignored.
+- [bugfix:] cancel may throw an error if the OS returns NIL values (iOS).
+- [bugfix:] Replacing a notification with the same ID may result into canceling both (iOS).
+
 #### Version 0.7.3 (16.03.2014)
 - [bugfix:] cancel callbacks have not been fired after all notifications have been canceled on iOS.
 - [change:] The `oncancel` callback will be called at last if `autoCancel` is set to true (iOS).

+ 4 - 1
src/ios/APPLocalNotification.m

@@ -106,7 +106,10 @@
         if ([self isNotificationScheduledWithId:id]) {
             UILocalNotification* notification = [self notificationWithId:id];
 
-            [self cancelNotification:notification fireEvent:NO];
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC),
+                           dispatch_get_main_queue(), ^{
+                [self cancelNotification:notification fireEvent:NO];
+            });
         }
 
         [self scheduleNotificationWithProperties:properties];