Skip to content

Commit

Permalink
Fix error when retrieving FCM token after updating to FCM 10.23
Browse files Browse the repository at this point in the history
The first time the app starts it works fine, but after restarting the app the code calls initRegistration too soon and it fails.
  • Loading branch information
dpalou committed Aug 29, 2024
1 parent 1f11511 commit a8ebed8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

if(![weakSelf usesFCM]) {
[weakSelf registerWithToken: token];
} else {
// Obtain the FCM token now that the APNS token is available, otherwise initRegistation fails.
[weakSelf initRegistration];
}
}];

Expand Down

0 comments on commit a8ebed8

Please sign in to comment.