What Bearer token should I be using for Firebase Cloud Messaging testing?

前端 未结 5 678
半阙折子戏
半阙折子戏 2020-12-29 06:45

I am trying to send a test notification using Firebase Cloud Messaging via Postman. I\'m doing a POST to this url

https://fcm.googleapis.com/v1/projects/[my         


        
5条回答
  •  醉酒成梦
    2020-12-29 07:41

    You have to generate new access token in Postman.

    First, ensure you have enabled FCM API in Google Developer Console. Than go to Google Developer Console -> APIs & Services -> Credentials. Look at "OAuth 2.0 client IDs" section. There should be at least one item in list. Download it as json file.

    In Postman open "Authorization" tab, select Type = "OAuth 2.0" than click "Get New Access Token". Dialog appears.

    Fields:

    Token Name - type what you want

    Grant Type = Authorization Code

    Callback URL = redirect_uris from downloaded json

    Auth URL = auth_uri

    Access Token URL = token_uri

    Client ID = client_id

    Client Secret = client_secret

    Scope = "https://www.googleapis.com/auth/firebase.messaging"

    State - leave empty

    Client Authentication = default, Send As Basic Auth Header

    Click "Request Token" and that's it.

提交回复
热议问题