Skip to content

Commit c99c12d

Browse files
authored
Merge pull request #695 from OneSignal/fix/always_register_for_push_on_main_thread
Always call registerForRemoteNotifications from the main thread
2 parents 10cb679 + 5eda5b5 commit c99c12d

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
@@ -955,7 +955,9 @@ + (BOOL)registerForAPNsToken {
955955
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE message:@"Firing registerForRemoteNotifications"];
956956

957957
waitingForApnsResponse = true;
958-
[[UIApplication sharedApplication] registerForRemoteNotifications];
958+
[OneSignalHelper dispatch_async_on_main_queue:^{
959+
[[UIApplication sharedApplication] registerForRemoteNotifications];
960+
}];
959961

960962
return true;
961963
}

0 commit comments

Comments
 (0)