Skip to content

Commit

Permalink
Merge pull request #575 from opencollector/moriyoshi/registerForRemot…
Browse files Browse the repository at this point in the history
…eNotifications-on-main-thread

Dispatch registerForRemoteNotifications on main thread to prevent runtime warnings
  • Loading branch information
Libin Lu authored Sep 26, 2017
2 parents d9f215f + a2412b8 commit 2ced2d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ios/RNFIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ - (void)messaging:(nonnull FIRMessaging *)messaging didRefreshRegistrationToken:
#endif
}

[[UIApplication sharedApplication] registerForRemoteNotifications];
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] registerForRemoteNotifications];
});
}

RCT_EXPORT_METHOD(subscribeToTopic: (NSString*) topic)
Expand Down

0 comments on commit 2ced2d0

Please sign in to comment.