Commit 8366689e by Sebastián Katzer

Fix at: not working under ios

parent 7bc42e65
...@@ -353,8 +353,14 @@ ...@@ -353,8 +353,14 @@
* *
* @return [ UNTimeIntervalNotificationTrigger* ] * @return [ UNTimeIntervalNotificationTrigger* ]
*/ */
- (UNTimeIntervalNotificationTrigger*) nonRepeatingTrigger - (UNNotificationTrigger*) nonRepeatingTrigger
{ {
id timestamp = [self valueForTriggerOption:@"at"];
if (timestamp) {
return [self triggerWithDateMatchingComponents:NO];
}
return [UNTimeIntervalNotificationTrigger return [UNTimeIntervalNotificationTrigger
triggerWithTimeInterval:[self timeInterval] repeats:NO]; triggerWithTimeInterval:[self timeInterval] repeats:NO];
} }
...@@ -369,7 +375,7 @@ ...@@ -369,7 +375,7 @@
id every = [self valueForTriggerOption:@"every"]; id every = [self valueForTriggerOption:@"every"];
if ([every isKindOfClass:NSString.class]) if ([every isKindOfClass:NSString.class])
return [self triggerWithDateMatchingComponents]; return [self triggerWithDateMatchingComponents:YES];
if ([every isKindOfClass:NSDictionary.class]) if ([every isKindOfClass:NSDictionary.class])
return [self triggerWithCustomDateMatchingComponents]; return [self triggerWithCustomDateMatchingComponents];
...@@ -402,7 +408,7 @@ ...@@ -402,7 +408,7 @@
* *
* @return [ UNCalendarNotificationTrigger* ] * @return [ UNCalendarNotificationTrigger* ]
*/ */
- (UNCalendarNotificationTrigger*) triggerWithDateMatchingComponents - (UNCalendarNotificationTrigger*) triggerWithDateMatchingComponents:(BOOL)repeats
{ {
NSCalendar* cal = [[NSCalendar alloc] NSCalendar* cal = [[NSCalendar alloc]
initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
...@@ -413,7 +419,7 @@ ...@@ -413,7 +419,7 @@
date.timeZone = [NSTimeZone defaultTimeZone]; date.timeZone = [NSTimeZone defaultTimeZone];
return [UNCalendarNotificationTrigger return [UNCalendarNotificationTrigger
triggerWithDateMatchingComponents:date repeats:YES]; triggerWithDateMatchingComponents:date repeats:repeats];
} }
/** /**
...@@ -456,7 +462,8 @@ ...@@ -456,7 +462,8 @@
region.notifyOnEntry = [[self valueForTriggerOption:@"notifyOnEntry"] boolValue]; region.notifyOnEntry = [[self valueForTriggerOption:@"notifyOnEntry"] boolValue];
region.notifyOnExit = [[self valueForTriggerOption:@"notifyOnExit"] boolValue]; region.notifyOnExit = [[self valueForTriggerOption:@"notifyOnExit"] boolValue];
return [UNLocationNotificationTrigger triggerWithRegion:region repeats:YES]; return [UNLocationNotificationTrigger triggerWithRegion:region
repeats:YES];
} }
/** /**
......
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