Skip to content

Commit

Permalink
update fcm sdk and use new api
Browse files Browse the repository at this point in the history
  • Loading branch information
krdevbuild committed Sep 29, 2020
1 parent 2c397e5 commit 124dd72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ xmlns:android="http://schemas.android.com/apk/res/android">
<header-file src="src/ios/FirebasePlugin.h" />
<source-file src="src/ios/FirebasePlugin.m" />

<framework src="Firebase/Crashlytics" type="podspec" spec="6.32.2" />
<framework src="Firebase/Analytics" type="podspec" spec="6.32.2" />
<framework src="Firebase/Messaging" type="podspec" spec="6.32.2" />
<framework src="Firebase/Crashlytics" type="podspec" spec="6.33.0" />
<framework src="Firebase/Analytics" type="podspec" spec="6.33.0" />
<framework src="Firebase/Messaging" type="podspec" spec="6.33.0" />
</platform>

<platform name="browser">
Expand Down
8 changes: 4 additions & 4 deletions src/ios/FirebasePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ - (void)pluginInitialize {
- (void) getInstanceId:(CDVInvokedUrlCommand *)command {
@try {
[self registerForRemoteNotification];
[[FIRInstanceID instanceID] instanceIDWithHandler:^(FIRInstanceIDResult * _Nullable result, NSError * _Nullable error) {
if (error == nil && result.token != nil) {
[self sendPluginSuccessWithMessage:result.token command:command];
[[FIRMessaging messaging] tokenWithCompletion:^(NSString * _Nullable token, NSError * _Nullable error) {
if (error == nil && token != nil) {
[self sendPluginSuccessWithMessage:token command:command];
} else {
[self sendPluginErrorWithError:error command:command];
}
Expand Down Expand Up @@ -181,7 +181,7 @@ - (void)unregister:(CDVInvokedUrlCommand *)command {
[self runOnMainThread:^{
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
}];
[[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error) {
[[FIRMessaging messaging] deleteDataWithCompletion:^(NSError * _Nullable error) {
if (error) {
[self sendPluginErrorWithError:error command:command];
} else {
Expand Down

0 comments on commit 124dd72

Please sign in to comment.