ソースを参照

Fire clear event also

Sebastián Katzer 8 年 前
コミット
766ec4ceb3
1 ファイル変更7 行追加3 行削除
  1. 7 3
      src/ios/APPLocalNotification.m

+ 7 - 3
src/ios/APPLocalNotification.m

@@ -582,6 +582,8 @@
     UNNotificationRequest* notification = response.notification.request;
     NSString* action = response.actionIdentifier;
     NSString* event  = action;
+    
+    completionHandler();
 
     if ([action isEqualToString:UNNotificationDefaultActionIdentifier]) {
         event = @"click";
@@ -589,10 +591,12 @@
     if ([action isEqualToString:UNNotificationDismissActionIdentifier]) {
         event = @"clear";
     }
-
+    
+    if (![event isEqualToString:@"clear"]) {
+        [self fireEvent:@"clear" notification:notification];
+    }
+    
     [self fireEvent:event notification:notification];
-
-    completionHandler();
 }
 
 #pragma mark -