瀏覽代碼

Always call ontrigger if the app runs in foreground

Sebastián Katzer 11 年之前
父節點
當前提交
86975e6047
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/ios/APPLocalNotification.m

+ 4 - 0
src/ios/APPLocalNotification.m

@@ -396,6 +396,10 @@
     NSTimeInterval fireDateDistance = [now timeIntervalSinceDate:fireDate];
     NSString* event = (fireDateDistance < 1) ? @"trigger" : @"click";
 
+    if ([[self applicationState] isEqualToString:@"foreground"]) {
+        event = @"trigger";
+    }
+
     if (autoCancel && [event isEqualToString:@"click"]) {
         [self cancelNotification:notification fireEvent:YES];
     }