【发布时间】:2016-09-26 16:56:05
【问题描述】:
我开发了一个应用程序,实现了推送通知。我没有收到 iOS 10 设备的任何推送通知。我已经检查了我的服务器中的设备令牌和证书。
即使在 iOS 10 上,此注册似乎也是成功的,因为随后调用了 Application didRegisterForRemoteNotificationsWithDeviceToken,因此我收到了来自 APNS 的令牌。
问题是当我向这个设备发送推送通知时,应用程序didReceiveRemoteNotification 永远不会被调用。
现在,据说UIApplicationDelegate 上的方法在iOS 10 上已弃用,我应该实现userNotificationCenter(:didReceive:withCompletionHandler:) 和userNotificationCenter(:willPresent:withCompletionHandler:)
【问题讨论】: