Эх сурвалжийг харах

Experimental decrease time-frame for trigger event

Sebastián Katzer 10 жил өмнө
parent
commit
0ae10b80cb

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
 - New `color` attribute for Android (Thanks to @Eusebius1920)
 - New `quarter` intervall for iOS & Android
 - Made small icon optional (Android)
+- Decreased time-frame for trigger event (iOS)
 - Windows platform works without hooks
 - `update` checks for permission like `schedule`
 - Fixed #634 option to skip permission check

+ 2 - 3
src/ios/APPLocalNotification.m

@@ -571,12 +571,11 @@
 {
     UILocalNotification* notification = [localNotification object];
 
-    if ([notification userInfo] == NULL || [notification wasUpdated] )
+    if ([notification userInfo] == NULL || [notification wasUpdated])
         return;
 
     NSTimeInterval timeInterval = [notification timeIntervalSinceLastTrigger];
-
-    NSString* event = (timeInterval <= 1 && deviceready) ? @"trigger" : @"click";
+    NSString* event = timeInterval < 0.2 && deviceready ? @"trigger" : @"click";
 
     [self fireEvent:event notification:notification];