Xcode 9(iOS 11)在注册Push(远程)通知时向我显示错误/警告.
这是错误消息
这是代码,我尝试过:
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.sound, .alert, .badge]) { (granted, error) in
if error == nil{
UIApplication.shared.registerForRemoteNotifications()
}
}
Run Code Online (Sandbox Code Playgroud)
错误/警告线:
UIApplication.shared.registerForRemoteNotifications()
怎么解决这个?