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