【发布时间】:2017-09-13 13:27:59
【问题描述】:
我正在使用 pod Localize,它是一个语言切换工具。
我的应用有一个首选项菜单,用户可以在其中从列表中更改应用语言。
当用户更改语言时,我也在UserDefaults 中设置AppleLanguages 键
Localize.setCurrentLanguage("nl")
UserDefaults.standard.set(["nl"], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
这适用于我的应用程序,除了通知本地化外,一切都很好。
我读过the apple documentation about the localization local and remote notifications。
我将本地化内容存储在我的应用中,并使用loc-key 和loc-args 发送通知。
但通知总是在用户的preferredlanguage 中收到,这是由 iphone 首选项设置的,并且可能与我的应用语言不同。
如何解决此问题并按应用特定语言本地化通知?
【问题讨论】:
标签: ios swift notifications localization apple-push-notifications