Mah*_*eri 7 android deep-linking firebase-cloud-messaging
我正在使用 GoogleFcm
向我的Android客户端发送通知
我想用 Deep Link 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"
}
}
Run Code Online (Sandbox Code Playgroud)
此请求向我指定的客户端发送通知,但未打开深层链接,单击推送时什么也没有发生
有没有办法从 Fcm Push 打开 Deep Link?
Mah*_*eri 12
Fcm 文档中没有提到此功能,但我自己尝试了一些测试并找到了解决方案:
我们需要放置link而不是click_action:
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"
"link": "example://my.app/products" <<-- Here is the solution
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2206 次 |
最近记录: |