Xcode 9 (iOS 11) showing me an error/warning while registering for Push (remote) notification.
Here is error message
And here is code, I've tried:
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in
if error == nil{
UIApplication.shared.registerForRemoteNotifications()
}
}
Error/Warning Line:
UIApplication.shared.registerForRemoteNotifications()
How to resolve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…