if (deviceToken == nil) {
print("There is no deviceToken saved yet.")
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().registerForRemoteNotifications()
}
这是我的代码许可。ios 9推送通知不显示,而应用程序打开时
究竟是什么问题? – tilo
虽然应用程序处于前台通知状态,但应用程序打开时不显示通知。 –
不检查已保存的'deviceToken',用户可以更改设置,而不是检查权限 – sage444