diff --git a/src/ios/PushPlugin.m b/src/ios/PushPlugin.m index 90475d109..eb7b69ef0 100644 --- a/src/ios/PushPlugin.m +++ b/src/ios/PushPlugin.m @@ -280,8 +280,10 @@ - (void)init:(CDVInvokedUrlCommand*)command; if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:categories]; - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; + [[UIApplication sharedApplication] registerForRemoteNotifications]; + }); } // Read GoogleService-Info.plist