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

前端 未结 7 1207
猫巷女王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:56

    This is what worked for me. Courtesy of @Mason11987 in the accepted comment above.

    DispatchQueue.main.async() { code }
    
    0 讨论(0)
提交回复
热议问题