浏览代码

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