Skip to content

Commit

Permalink
completed for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikinfodesk committed May 26, 2017
1 parent e4f01f9 commit 72e5987
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/ios/FirebasePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,18 @@ - (void)unsubscribe:(CDVInvokedUrlCommand *)command {
}

- (void)unregister:(CDVInvokedUrlCommand *)command {
//TODO
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
[[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error){
if (error) {
NSLog(@"Unable to delete instance");
} else {
NSString* currentToken = [[FIRInstanceID instanceID] token];
if (currentToken != nil) {
[self sendToken:currentToken];
}
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
}];
}

- (void)onNotificationOpen:(CDVInvokedUrlCommand *)command {
Expand Down

0 comments on commit 72e5987

Please sign in to comment.