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

In swift4

You can solve this issue with

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

Hope this will help…

Leave a Comment