Send silent push notification from Firebase console

两盒软妹~` 提交于 2019-11-30 09:15:21
woodii

There is no way to send notifications different from the standard kind from the Firebase Console.

A quite convenient way is to use Postman or curl with a set Authorization Header.

curl -H "Content-type: application/json" -H "Authorization:key=<YOUR-API-KEY>"  -X POST -d '{ "data": { "foo": "1","bar": "2"},"to" : "<YOUR-DEVICE-TOKEN>"}' https://fcm.googleapis.com/fcm/send

You actually CAN send silent notifications from FCN. Check here.

Note: On iOS, set content_available when the app server needs to send a send-to-sync message. An inactive client app executes your logic in the background, while an app in the foreground passes the message to didReceiveRemoteNotification:.

Notice that the key you have to use is content_available, with underscore; different from content-available which is with a hyphen.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!