How do I get my Firebase registration key?

Firebase allows us to send notifications through our own app by sending a request POST

.

This tutorial provides instructions on how to make this request. However, there is a field in JSON"to"

where I have to put the registration key .

Where can I get this registration key ? There are no instructions for this.

Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA

{
  "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
  "data" : {
    ...
  },
}

      

+3


source to share


1 answer


To get the token, call FirebaseInstanceId.getInstance().getToken();

, After this step, to see the token, just output to Logcat

Sample code:



String token = FirebaseInstanceId.getInstance().getToken();
Log.i("MainActivity", "Token: " + token);

      

0


source







All Articles