deleteInstanceId feature (Android only)
This commit is contained in:
parent
b53bf5bbe8
commit
e6cb5fed60
|
@ -72,6 +72,17 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements L
|
|||
promise.resolve(FirebaseInstanceId.getInstance().getToken());
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void deleteInstanceId(Promise promise){
|
||||
try {
|
||||
FirebaseInstanceId.getInstance().deleteInstanceId();
|
||||
promise.resolve(null);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
promise.reject(null, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void createLocalNotification(ReadableMap details) {
|
||||
Bundle bundle = Arguments.toBundle(details);
|
||||
|
|
|
@ -608,6 +608,10 @@ declare module "react-native-firebase" {
|
|||
* This token can be used in the Firebase console to send messages to directly.
|
||||
*/
|
||||
getToken(forceRefresh?: Boolean): Promise<string>
|
||||
/**
|
||||
* Reset Instance ID and revokes all tokens.
|
||||
*/
|
||||
deleteInstanceId(): Promise<any>
|
||||
/**
|
||||
* On the event a devices FCM token is refreshed by Google,
|
||||
* the new token is returned in a callback listener.
|
||||
|
|
|
@ -109,6 +109,14 @@ export default class Messaging extends ModuleBase {
|
|||
return this._native.getToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset Instance ID and revokes all tokens.
|
||||
* @returns {*|Promise.<*>}
|
||||
*/
|
||||
deleteInstanceId() {
|
||||
return this._native.deleteInstanceId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and display a local notification
|
||||
* @param notification
|
||||
|
|
Loading…
Reference in New Issue