Explorar o código

Always call ontrigger if the app runs in foreground

Sebastián Katzer %!s(int64=11) %!d(string=hai) anos
pai
achega
86975e6047
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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];
     }