From 73cbc66bb96b348ec791e6854d6c24e6d85b2fa8 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Sep 2017 00:21:27 +0200 Subject: cordova-plugin-firebase --- .../android/FirebasePluginInstanceIDService.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java (limited to 'StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java') diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java b/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java new file mode 100755 index 00000000..96140f02 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java @@ -0,0 +1,26 @@ +package org.apache.cordova.firebase; + +import android.util.Log; + +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.iid.FirebaseInstanceIdService; + + +public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { + + private static final String TAG = "FirebasePlugin"; + + /** + * Called if InstanceID token is updated. This may occur if the security of + * the previous token had been compromised. Note that this is called when the InstanceID token + * is initially generated so this is where you would retrieve the token. + */ + @Override + public void onTokenRefresh() { + // Get updated InstanceID token. + String refreshedToken = FirebaseInstanceId.getInstance().getToken(); + Log.d(TAG, "Refreshed token: " + refreshedToken); + + FirebasePlugin.sendToken(refreshedToken); + } +} -- cgit v1.2.3-70-g09d2