浏览代码

Support for new trigger option in: (iOS)

Sebastián Katzer 8 年之前
父节点
当前提交
2e0bcaf059
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/ios/APPNotificationOptions.m

+ 8 - 1
src/ios/APPNotificationOptions.m

@@ -464,7 +464,14 @@
  */
 - (double) timeInterval
 {
-    return MAX(0.01f, [self.triggerDate timeIntervalSinceDate:[NSDate date]]);
+    double interval = [[self valueForTriggerOption:@"in"]
+                       doubleValue];
+    
+    if (interval == 0) {
+        interval = [self.triggerDate timeIntervalSinceDate:NSDate.date];
+    }
+    
+    return MAX(0.01f, interval);
 }
 
 /**