You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Authenticate a service account and authorize it to access Firebase services
you must generate a private key file in JSON format.
To generate a private key file for your service account:
In the Firebase console, open Settings > Service Accounts.
Click Generate New Private Key, then confirm by clicking Generate Key.
Securely store the JSON file containing the key.
有三个topic要谈:
消息格式: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
pom.xml
最新版本请参见: https://firebase.google.com/docs/admin/setup#add-sdk
Authenticate a service account and authorize it to access Firebase services
you must generate a private key file in JSON format.
To generate a private key file for your service account:
使用以上json文件初始化FCM Admin SDK
如果是通过设置环境变量
GOOGLE_APPLICATION_CREDENTIALS
指定json文件的位置, 则以上代码修改为:
例子:
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
或者使用以上json文件得到一个short-lived JWT token
如果要使用FCM service, SCOPES的值必须为
https://www.googleapis.com/auth/firebase.messaging
使用JWT Token
以上整理自: https://firebase.google.com/docs/cloud-messaging/auth-server
搭建FCM Server的要求
https://firebase.google.com/docs/cloud-messaging/server#role
搭建FCM Server的两种方式
发送消息 (cyper实战)
App端 用到的 Dart package (pub spec)
Pub Spec: firebase_messaging 6.0.13
References
Spring Boot: Send push notifications from Spring Boot server-side application using FCM
新鲜出炉的:Flutter Push Notifications using flutter firebase messaging with example
Concise: FCM Push Notifications for Flutter
FilledStacks: Push Notifications in Flutter using Firebase
The text was updated successfully, but these errors were encountered: