Преглед на файлове

fix notif not firing IOS 10

PC Dreams (Paulo Cristo) преди 9 години
родител
ревизия
706df5030a
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      src/ios/APPLocalNotification.m

+ 3 - 0
src/ios/APPLocalNotification.m

@@ -78,6 +78,8 @@
 
             notification = [[UILocalNotification alloc]
                             initWithOptions:options];
+            notification.timeZone = [NSTimeZone defaultTimeZone];
+            notification.repeatInterval = 0;
 
             [self scheduleLocalNotification:[notification copy]];
             [self fireEvent:@"schedule" notification:notification];
@@ -710,6 +712,7 @@
          NSDateComponents *dateComponents = [gregorianCalendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit
          | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit
                                                            fromDate:fireDate];
+         [dateComponents setTimeZone:[NSTimeZone defaultTimeZone]];
         
         /// 4. update application icon badge number
         //content.badge = @([[UIApplication sharedApplication] applicationIconBadgeNumber] + 1);