Skip to content

Commit

Permalink
Fix iOS-ESM notification schedule error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuki Nishiyama committed May 9, 2019
1 parent 90501c1 commit ca42011
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AWAREFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'AWAREFramework'
s.version = '1.4.11'
s.version = '1.4.12'
s.summary = 'AWARE: An Open-source Context Instrumentation Framework'

# This description is used to generate tags and improve search results.
Expand Down
18 changes: 11 additions & 7 deletions AWAREFramework/Classes/ESM/ESMScheduleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,24 @@ - (BOOL) setScheduleByConfig:(NSArray <NSDictionary * > * _Nonnull) config {
for (NSNumber * hour in hours) {
EntityESMSchedule * entityESMSchedule = (EntityESMSchedule *) [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([EntityESMSchedule class])
inManagedObjectContext:context];
entityESMSchedule.fire_hour = hour;
entityESMSchedule.fire_hour = hour;
entityESMSchedule.expiration_threshold = expiration;
entityESMSchedule.start_date = startDate;
entityESMSchedule.end_date = endDate;
entityESMSchedule.end_date = endDate;
entityESMSchedule.notification_title = notificationTitle;
entityESMSchedule.notification_body = notificationBody;
entityESMSchedule.notification_body = notificationBody;
entityESMSchedule.randomize_schedule = randomize_schedule;
entityESMSchedule.schedule_id = scheduleId;
entityESMSchedule.contexts = eventContext;
entityESMSchedule.interface = interface;
entityESMSchedule.contexts = eventContext;
entityESMSchedule.interface = interface;

if (![hour isEqualToNumber:@(-1)]) {
[self setHourBasedNotification:entityESMSchedule datetime:[NSDate new]];
}

for (NSDictionary * esmDict in esms) {
NSDictionary * esm = [esmDict objectForKey:@"esm"];
EntityESM * entityEsm = (EntityESM *) [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([EntityESM class])
NSDictionary * esm = [esmDict objectForKey:@"esm"];
EntityESM * entityEsm = (EntityESM *) [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([EntityESM class])
inManagedObjectContext:context];
entityEsm.esm_type = [esm objectForKey:@"esm_type"];
entityEsm.esm_title = [esm objectForKey:@"esm_title"];
Expand Down

0 comments on commit ca42011

Please sign in to comment.