Local notifications are not firing in ios10

后端 未结 3 1229
不思量自难忘°
不思量自难忘° 2021-01-12 15:55

I\'m using UNUserNotificationCenter for ios 10. For testing, I\'m setting a local notification for 10 seconds from current time.

This is what I tried,

3条回答
  •  鱼传尺愫
    2021-01-12 16:07

    Set NSDateComponents like:

    NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute|NSCalendarUnitSecond|NSCalendarUnitTimeZone fromDate:[[NSDate date] dateByAddingTimeInterval:10]];
    

提交回复
热议问题