Skip to content

Instantly share code, notes, and snippets.

@andrisasuke
Created December 4, 2017 06:34
Show Gist options
  • Save andrisasuke/9609a7698d6f10c2298f866130ee2b67 to your computer and use it in GitHub Desktop.
Save andrisasuke/9609a7698d6f10c2298f866130ee2b67 to your computer and use it in GitHub Desktop.
Get firebase_token
public class OyFirebaseInstanceIdService extends FirebaseInstanceIdService {
private static final String TAG = "OyFirebaseIis";
@Inject
LocalPreferences localPreferences;
private CompositeSubscription subscriptions;
@Override
public void onCreate() {
super.onCreate();
AndroidInjection.inject(this);
subscriptions = new CompositeSubscription();
}
@Override
public void onTokenRefresh() {
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d(TAG, "token: " + refreshedToken);
//sendRegistrationToServer(refreshedToken);
//or store to local cache
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment