File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,22 @@ - (void)unsubscribe:(CDVInvokedUrlCommand *)command {
485485}
486486
487487- (void )unregister : (CDVInvokedUrlCommand *)command {
488- [self deleteInstallationId: command];
488+ @try {
489+ __block NSError * error = nil ;
490+ [[FIRMessaging messaging ] deleteTokenWithCompletion: ^(NSError * _Nullable deleteTokenError) {
491+ if (error == nil && deleteTokenError != nil ) error = deleteTokenError;
492+ if ([FIRMessaging messaging ].isAutoInitEnabled ){
493+ [self _getToken: ^(NSString * token, NSError * getError) {
494+ if (error == nil && getError != nil ) error = getError;
495+ [self handleEmptyResultWithPotentialError: error command: command];
496+ }];
497+ }else {
498+ [self handleEmptyResultWithPotentialError: error command: command];
499+ }
500+ }];
501+ }@catch (NSException *exception) {
502+ [self handlePluginExceptionWithContext: exception :command];
503+ }
489504}
490505
491506- (void ) onOpenSettings : (CDVInvokedUrlCommand *)command {
You can’t perform that action at this time.
0 commit comments