How to get the instance ID list of Firebase applic

2019-09-08 11:48发布

问题:

I want to get a list of Registration Tokens from my Firebase application via Web API. How do I do it?

An example of what I was thinking, below.

Example POST request:

https://iid.googleapis.com/iid/foooooooooooooHowDoIt
Content-Type:application/json
Authorization:key=API_KEY
{
   "application": "com.iid.example_myapp"
}

Example result:

HTTP 200 OK
{
   "tokens": ["nKctODamlM4:CKrh_PC8kIb7O...", "1uoasi24:9jsjwuw..."],
}

Reference: https://developers.google.com/instance-id/reference/server

回答1:

There is currently no API available that retrieves all/specific registration tokens for an app.

From the docs:

After you've obtained the token, you can send it to your app server and store it using your preferred method.

It's not explicitly said in any of the documentations, but IMHO, it is the developer's responsibility to store the registration tokens on their own app server for later use.