Skip to content

Commit 124dd72

Browse files
author
krdevbuild
committed
update fcm sdk and use new api
1 parent 2c397e5 commit 124dd72

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ xmlns:android="http://schemas.android.com/apk/res/android">
9090
<header-file src="src/ios/FirebasePlugin.h" />
9191
<source-file src="src/ios/FirebasePlugin.m" />
9292

93-
<framework src="Firebase/Crashlytics" type="podspec" spec="6.32.2" />
94-
<framework src="Firebase/Analytics" type="podspec" spec="6.32.2" />
95-
<framework src="Firebase/Messaging" type="podspec" spec="6.32.2" />
93+
<framework src="Firebase/Crashlytics" type="podspec" spec="6.33.0" />
94+
<framework src="Firebase/Analytics" type="podspec" spec="6.33.0" />
95+
<framework src="Firebase/Messaging" type="podspec" spec="6.33.0" />
9696
</platform>
9797

9898
<platform name="browser">

src/ios/FirebasePlugin.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ - (void)pluginInitialize {
2929
- (void) getInstanceId:(CDVInvokedUrlCommand *)command {
3030
@try {
3131
[self registerForRemoteNotification];
32-
[[FIRInstanceID instanceID] instanceIDWithHandler:^(FIRInstanceIDResult * _Nullable result, NSError * _Nullable error) {
33-
if (error == nil && result.token != nil) {
34-
[self sendPluginSuccessWithMessage:result.token command:command];
32+
[[FIRMessaging messaging] tokenWithCompletion:^(NSString * _Nullable token, NSError * _Nullable error) {
33+
if (error == nil && token != nil) {
34+
[self sendPluginSuccessWithMessage:token command:command];
3535
} else {
3636
[self sendPluginErrorWithError:error command:command];
3737
}
@@ -181,7 +181,7 @@ - (void)unregister:(CDVInvokedUrlCommand *)command {
181181
[self runOnMainThread:^{
182182
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
183183
}];
184-
[[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error) {
184+
[[FIRMessaging messaging] deleteDataWithCompletion:^(NSError * _Nullable error) {
185185
if (error) {
186186
[self sendPluginErrorWithError:error command:command];
187187
} else {

0 commit comments

Comments
 (0)