Firebase 云通知本地化

问题描述 投票:0回答:1

尝试获取本地化密钥以与 firebase 和节点 firebase.admin 实用程序一起使用,但无法使其工作。 我在发送时收到了一个 messageId,并且没有任何错误,所以有点卡住了。

我使用 Firebase 函数发送通知,因此一切都在 firebase 中运行。

admin.messaging().sendToTopic("my_topic", {
    "notification": {
      "titleLocKey" : "FRXT",
      "bodyLocKey" : "FRXB",
      "bodyLocArgs" : "['test']"
    }
  }).then(function(resp){
    res.send(200, resp)
  })

我想我在这里做错了一些我看不到的事情,所以如果有聪明的人请大声喊出来。使用的密钥位于 iOS 本地化字符串文件中。如果我只使用标题和正文,推送也可以正常工作。

javascript firebase firebase-cloud-messaging firebase-admin
1个回答
0
投票

截至今天,有效负载应为:

{
    "android": {
        "notification": {
          "title_loc_key" : "notification_title",
          "body_loc_key" : "notification_message"
        }
    }
}

本地化字符串应在 strings.xml 文件中声明。

© www.soinside.com 2019 - 2024. All rights reserved.