我正在使用 Google 的 Fcm
向我的 Android 客户端发送通知。
我想要通过深度链接 URL(例如 example://my.app/products
)打开特定的屏幕。
这是使用 REST API 发送通知的端点。
https://fcm.googleapis.com/fcm/send
Content-Type: application/json
Authorization: key={SERVER_KEY}
{
"to" : "{Firebase client token}",
"collapse_key" : "type_a",
"notification" : {
"body" : "Body of Your Notification",
"title": "Title of Your Notification"
"click_action": "example://my.app/products"
}
}
这个请求会向我指定的客户端发送通知,但是当点击推送时不会打开Deep Link,什么也没有发生。
是否有一种方法可以从FCM推送中打开Deep Link?
{ "error": { "code": 400, "message": "接收到无效的 JSON 负载。在 'message.android.notification' 中找不到未知名称“link”的字段。", "status": "INVALID_ARGUMENT", "details": [ .... ] } ] } }
- Dario Scoppelletti