react native firebase mobile推送通知

发布时间 2023-09-07 10:33:19作者: 一恋千里

一、使用postman推送mobile通知

构建推送请求,参考firebase官网:https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=zh-cn

 

 

 token:即接收通知设备token,

 OAuth toekn获取:

1、Got to Google OAuth Playground: https://developers.google.com/oauthplayground

2、在"Input your own scopes" 按钮输入这个url: https://www.googleapis.com/auth/firebase.messaging

3、点击 Authorize API.

4、Pick correct user for authorisation and allow access,输入自己的google账号邮箱

5、在 Step 2: Exchange authorization code for tokens 点击 Exchange authorisation code for tokens

6、这里可以获取token type 为Bearer的access token

 

 

 这样就可以在postman推送消息,mobile接收,实现以下效果: