浏览代码

iOS 10 - all events fired as other iOS versions

Sparsh 9 年之前
父节点
当前提交
9ad32cf205
共有 1 个文件被更改,包括 16 次插入18 次删除
  1. 16 18
      src/ios/APPLocalNotification.m

+ 16 - 18
src/ios/APPLocalNotification.m

@@ -736,28 +736,26 @@
         }];
     } 
 
-    if ((IsAtLeastiOSVersion(@"10.0") && [event  isEqual: @"click"]) || !IsAtLeastiOSVersion(@"10.0")) { 
-        NSString* js;
-        NSString* params = [NSString stringWithFormat:
-                            @"\"%@\"", self.applicationState];
+    NSString* js;
+    NSString* params = [NSString stringWithFormat:
+                        @"\"%@\"", self.applicationState];
 
-        if (notification) {
-            NSString* args = [notification encodeToJSON];
+    if (notification) {
+        NSString* args = [notification encodeToJSON];
 
-            params = [NSString stringWithFormat:
-                      @"%@,'%@'",
-                      args, self.applicationState];
-        }
+        params = [NSString stringWithFormat:
+                  @"%@,'%@'",
+                  args, self.applicationState];
+    }
 
-        js = [NSString stringWithFormat:
-              @"cordova.plugins.notification.local.core.fireEvent('%@', %@)",
-              event, params];
+    js = [NSString stringWithFormat:
+          @"cordova.plugins.notification.local.core.fireEvent('%@', %@)",
+          event, params];
 
-        if (deviceready) {
-            [self.commandDelegate evalJs:js];
-        } else {
-            [self.eventQueue addObject:js];
-        }
+    if (deviceready) {
+        [self.commandDelegate evalJs:js];
+    } else {
+        [self.eventQueue addObject:js];
     }
 }