Commit d115a53c by Sebastián Katzer

Implemented `single` property for location based trigger on iOS

parent 16fa62f4
......@@ -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
......
......@@ -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];
}
/**
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment