Permalink
Browse files

when token updated

  • Loading branch information...
1 parent f1c7975 commit adc61ca7a0fea12bdb323f5d1cdc7b3e4dabb491 @susemi99 committed Jan 26, 2016
Showing with 24 additions and 0 deletions.
  1. +24 −0 app/src/main/java/kr/susemi99/gcm/services/InstanceIDUpdateListenerService.java
@@ -0,0 +1,24 @@
+package kr.susemi99.gcm.services;
+
+import android.content.Intent;
+
+import com.google.android.gms.iid.InstanceIDListenerService;
+
+/**
+ * Created by susemi99 on 2016. 1. 26..
+ */
+public class InstanceIDUpdateListenerService extends InstanceIDListenerService
+{
+ /**
+ * Called if InstanceID token is updated. This may occur if the security of
+ * the previous token had been compromised. This call is initiated by the
+ * InstanceID provider.
+ */
+ @Override
+ public void onTokenRefresh()
+ {
+ super.onTokenRefresh();
+ Intent intent = new Intent(this, RegistrationIntentService.class);
+ startService(intent);
+ }
+}

0 comments on commit adc61ca

Please sign in to comment.