How to get IID_TOKEN for google id service?

I am trying to register a theme with FCM using the code below. According to my understanding, I need two Keys for registration, first it is IID_TOKEN, and the second is FCM_APP_KEY.

I have FCM_APP_KEY, but I can't find a club or a site from where I can get the google service ID service token (IID_TOKEN).

This will be very helpful if someone can tell a process or site to get the IID_TOKEN. Thanks in advance.

https://iid.googleapis.com/iid/v1/IID_TOKEN/rel/topics/TOPIC
Content-Type:application/json
Authorization:key=FCM_APP_KEY

      

+3


source to share


1 answer


You don't need to register a theme.

Themes are automatically created when the application calls



FirebaseCloudMessaging.getInstance().subscribeToTopic("topic-name")

      

The API you mentioned in the question is used when you have the FirebaseInstanceId of an application (mobile / client) (obtained via FirebaseInstanceId.getInstance().getToken()

) and you want to subscribe to that application on a specific topic from your server side, instead of calling the method subscribeToTopic(..)

mentioned above in the client ...

+1


source







All Articles