【发布时间】:2021-02-25 10:36:47
【问题描述】:
我正在使用 Firebase 云消息传递、云函数和 Flutter 作为框架发送 FCM 推送通知。自 3 小时以来,我一直在寻找接收带有翻译的后台通知的解决方案。我想以设备语言显示翻译。
我找到的是titleLocKey 和bodyLocKey 之类的参数,但我找不到任何使用这些参数的方法。在我的项目或服务器环境中,我必须在哪里包含这些变量?
我这样触发通知:
// Push Notification
const payload: admin.messaging.MessagingPayload = {
notification: {
title: "New User",
body: "A new user entered your platform",
badge: "1",
}
}
fcm.sendToDevice(userToken, payload);
你有什么想法吗?
【问题讨论】:
标签: firebase flutter google-cloud-functions firebase-cloud-messaging