-6

I am creating chatting application. When user login I want to store his unique ID which is generated by push. How to get that ID.

Rahul
  • 73
  • 10

1 Answers1

0

Check your MyFirebaseInstanceIDService class there will be a method onTokenRefresh(). You will get refreshedToken in this method like below:

public void onTokenRefresh() {
    // Get updated InstanceID token.
    String refreshedToken = FirebaseInstanceId.getInstance().getToken();

    // TODO: Implement this method to send any registration to your app's servers.
    sendRegistrationToServer(refreshedToken);
}
saty
  • 66
  • 7
  • How to update particular child Firebase suport = ref.child(uniqueId).child("status"); suport.setValue("free"); is this will update tat status or create new ? – Rahul Oct 03 '16 at 12:23