Skip to content

Commit

Permalink
feat!(ios): move FIRApp configure to pluginInitialize
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Sep 12, 2024
1 parent 27474eb commit 0e0928e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ - (void)pluginInitialize {

if(![self usesFCM]) {
NSLog(@"[PushPlugin] Falling back onto APNS");
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[FIRApp configure];
});
}
}

Expand Down Expand Up @@ -368,12 +372,7 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
if([self usesFCM]) {
NSLog(@"[PushPlugin] Setting APNS Token to FCM");
dispatch_async(dispatch_get_main_queue(), ^{
if([FIRApp defaultApp] == nil)
[FIRApp configure];

// Ensure the APNS token is passed to Firebase Messaging
[[FIRMessaging messaging] setAPNSToken:deviceToken];

[self initFirebaseMessaging:[self iOSOptions]];
});
}
Expand Down

0 comments on commit 0e0928e

Please sign in to comment.