Skip to content

Commit 5eda5b5

Browse files
committed
Always call registerForRemoteNotifications from the main thread
1 parent 709f059 commit 5eda5b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,9 @@ + (BOOL)registerForAPNsToken {
947947
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE message:@"Firing registerForRemoteNotifications"];
948948

949949
waitingForApnsResponse = true;
950-
[[UIApplication sharedApplication] registerForRemoteNotifications];
950+
[OneSignalHelper dispatch_async_on_main_queue:^{
951+
[[UIApplication sharedApplication] registerForRemoteNotifications];
952+
}];
951953

952954
return true;
953955
}

0 commit comments

Comments
 (0)