Skip to content

Commit

Permalink
fix(ios): handle nil messaging token (#3790)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Hardy <[email protected]>

[publish]
  • Loading branch information
TPXP authored Jun 18, 2020
1 parent 8c8d448 commit b2ffe11
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ - (void)observe {

// JS -> `onTokenRefresh`
- (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken {
if (fcmToken == nil) { // Don't crash when the token is reset
return;
}
[[RNFBRCTEventEmitter shared] sendEventWithName:@"messaging_token_refresh" body:@{
@"token": fcmToken
}];
Expand Down

0 comments on commit b2ffe11

Please sign in to comment.