UIApplication.registerForRemoteNotifications() must be called from main thread only

前端 未结 7 1205
猫巷女王i
猫巷女王i 2020-11-30 00:23

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:<

7条回答
  •  有刺的猬
    2020-11-30 00:40

    Hope this will help

    DispatchQueue.main.async(execute: {
      UIApplication.shared.registerForRemoteNotifications()
    })
    

提交回复
热议问题