iOS UILocalNotification not being displayed while app in background

孤者浪人 提交于 2019-12-06 00:02:50

See the example in Apple's docs: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1

Could it be that not setting timeZone to [NSTimeZone defaultTimeZone] is causing the problem? GMT is assumed if timeZone isn't set (nil default).

Have you tried wrapping the code in a background task?

Ok, found what it was, there was an errant [[UIApplication sharedApplication] cancelAllLocalNotifications]; being sent when entering the background.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!