浏览代码

Implemented `single` property for location based trigger on iOS

Sebastián Katzer 8 年之前
父节点
当前提交
d115a53cee
共有 3 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      README.md
  2. 2 1
      src/ios/APPNotificationOptions.m
  3. 1 0
      www/local-notification-util.js

+ 1 - 1
README.md

@@ -304,7 +304,7 @@ The properties depend on the trigger type. Not all of them are supported across
 |              | radius        | Int     |                  |         | x   |
 |              | notifyOnEntry | Boolean |                  |         | x   |
 |              | notifyOnExit  | Boolean |                  |         | x   |
-|              | repeat        | Boolean |                  |
+|              | single        | Boolean |                  |         | x   |
 
 
 ## Progress

+ 2 - 1
src/ios/APPNotificationOptions.m

@@ -461,6 +461,7 @@
 {
     NSArray* center = [self valueForTriggerOption:@"center"];
     double radius   = [[self valueForTriggerOption:@"radius"] doubleValue];
+    BOOL single     = [[self valueForTriggerOption:@"single"] boolValue];
 
     CLLocationCoordinate2D coord =
     CLLocationCoordinate2DMake([center[0] doubleValue], [center[1] doubleValue]);
@@ -474,7 +475,7 @@
     region.notifyOnExit  = [[self valueForTriggerOption:@"notifyOnExit"] boolValue];
 
     return [UNLocationNotificationTrigger triggerWithRegion:region
-                                                    repeats:YES];
+                                                    repeats:!single];
 }
 
 /**

+ 1 - 0
www/local-notification-util.js

@@ -234,6 +234,7 @@ exports.convertTrigger = function (options) {
         trigger.notifyOnEntry = !!trigger.notifyOnEntry;
         trigger.notifyOnExit  = trigger.notifyOnExit === true;
         trigger.radius        = trigger.radius || 5;
+        trigger.single        = !!trigger.single;
     }
 
     if (!isCal || trigger.at) {