简体   繁体   English

后台应用中的推送通知iOS的异常行为

[英]Strange behavior with Push notification ios in app in Background

I am sending a push notification with the following payload: 我正在使用以下有效负载发送推送通知:

{"aps":{"alert":{"loc-key":"general","loc-args":["Test DEFAULT."]},"badge":1,"sound":"default"}}

in the the localization string, i have it defined as such: 在本地化字符串中,我将其定义为:

"general"="%@";

While the app is open, the notification is fine since I handle it when I get the response from apple. 当应用程序打开时,通知是很好的,因为当我从Apple得到响应时,我会处理它。 But when the app is in the background or terminated, I would get "general" as the title and "general" in the body in the notification. 但是,当应用程序在后台运行或终止时,通知中的标题将为“ general”,正文中将为“ general”。

Not to sure what is going on, since the structure I have seems to match what apple has documented. 不确定发生了什么,因为我的结构似乎与苹果记录的结构相符。

It looks as if the app can't find your localization string. 该应用似乎找不到您的本地化字符串。 Make sure there isn't any problem with your Localizable.strings file for the current language selected by the user. 确保您的Localizable.strings文件对于用户选择的当前语言没有任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM