星空网 > 软件开发 > 操作系统

iOS 疑难杂症 — — 推送本地国际化 loc

 

 

声明 
  欢迎转载,但请保留文章原始出处:) 
  博客园:http://www.cnblogs.com
  农民伯伯: http://over140.cnblogs.com

 

正文

  一、准备

  推送本地国际化官方文档:

    https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7

 

  NWPusher 测试推送内容:

{"aps":{"alert":{"title":"Shou","loc-key":"notification_push_live","loc-args":["over140","broadcast test"]},"badge":0,"sound":"default","content-available": 1}}

 

  在 en.lproj/Localizable.strings 中对应写(系统语言默认英语)

"notification_push_live" = ":space_invader: %@ is broadcasting %@";

 

  二、问题

    收到推送后 body 直接显示的是 notification_push_live ,这说明国际化失败了没有找到字符串。

 

  三、原因 & 解决

    发现工程有一个空的 Base.lproj/Localizable.strings ,里面什么都没有,项目创建后就不用也没删。

    —— 删了就好了,,,另外测试了一下,如果是不支持的语言也默认会是英语




原标题:iOS 疑难杂症 — — 推送本地国际化 loc

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

成都快递到泰国:https://www.goluckyvip.com/tag/89269.html
市场商机:https://www.goluckyvip.com/tag/8927.html
广州至泰国快递:https://www.goluckyvip.com/tag/89270.html
泰国kerry快递介绍:https://www.goluckyvip.com/tag/89271.html
广东寄泰国快递:https://www.goluckyvip.com/tag/89272.html
杭州快递泰国:https://www.goluckyvip.com/tag/89273.html
怪物在游轮上复活的电影 怪物在游轮上复活的电影叫什么:https://www.vstour.cn/a/411230.html
在线旅游如何选择更优惠的旅游产品?:https://www.vstour.cn/a/411231.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流