From 2e52940754b27fc56a1ea08ff19d157c0da5eebf Mon Sep 17 00:00:00 2001 From: Riyaz Date: Thu, 13 Jul 2017 18:18:15 +0530 Subject: [PATCH] included delete instance function on android --- .../com/evollu/react/fcm/FIRMessagingModule.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java index 30adfc7..1963036 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java @@ -27,7 +27,7 @@ import android.os.Bundle; import android.util.Log; import android.content.Context; - +import java.io.IOException; import java.util.ArrayList; import java.util.Map; import java.util.Set; @@ -74,6 +74,17 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li 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(e.getCause()); + } + } + @ReactMethod public void presentLocalNotification(ReadableMap details) { Bundle bundle = Arguments.toBundle(details); -- 2.26.2