Parcourir la source

Always call ontrigger if the app runs in foreground

Sebastián Katzer il y a 11 ans
Parent
commit
86975e6047
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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];
     }