Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
🐛🍎 Issue #1988: iOS 11 + xcode 9: warnings on calling UI methods from…
Browse files Browse the repository at this point in the history
… a background thread
  • Loading branch information
macdonst committed Oct 16, 2017
1 parent 073d6be commit cef862b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cef862b

Please sign in to comment.