【发布时间】:2018-01-07 17:01:15
【问题描述】:
我正在使用 FCM 向 Android 和 iOS 发送本地化通知。流程有效,两个平台都收到通知,但在 iOS 上,如果我尝试发送本地化密钥和参数,本地化失败。如果我发送一个不需要 args 的 resourceKey,它就可以正常工作。
负载请求示例
curl -X POST --header "Authorization:key=AAAAR*************aHT" --Header "Content-Type:application/json" https://fcm.googleapis.com/fcm/send -d "{
"notification":{
"title_loc_key":"titleResourceKey",
"body_loc_key":"bodyResourceKey",
"body_loc_args": ["test", "test"]
"badge":"1",
"sound":"default"
},
"priority":"High",
"to": "dqIeO*****relj3k}"
iOS localizable.strings 文件中的值。
"titleResourceKey"="title string";
"bodyResourceKey"="s% s% has passed.";
android strings.xml 文件中的值。
<string formatted="false" name="titleResourceKey">"title string"</string>
<string formatted="false" name="bodyResourceKey">"s% s% has passed."</string>
【问题讨论】:
标签: android ios firebase-cloud-messaging