Kaynağa Gözat

Always call ontrigger if the app runs in foreground

Sebastián Katzer 11 yıl önce
ebeveyn
işleme
86975e6047
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  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];
     }