使用Hybrid Mobile应用程序问题显示APN本地化格式化字符串

时间:2016-03-09 02:49:15

标签: ios apple-push-notifications ibm-mobilefirst localizable.strings

我正在使用Mobile First Platform 7混合移动应用程序,但我没有使用MFP服务器而不是WebSphere Liberty配置文件,我可以发送和接收苹果推送通知,但在本地化格式化字符串的实现过程中,我有这个问题,当通知到达时,警报消息不会根据密钥显示本地化字符串。它显示“GAME_PLAY_REQUEST_FORMAT”,而不是“Jenna和Frank邀请你玩垄断”。

参考..本地化格式化字符串https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7

该服务正在发送以下结构。

aps =     {
        alert =         {
            "action-loc-key" = Open;
            "loc-args" =             (
                Jenna,
                Frank
            );
            "loc-key" = "GAME_PLAY_REQUEST_FORMAT";
        };
        badge = 12;
        sound = default;
    };

我在message.string文件中添加了键和值"GAME_PLAY_REQUEST_FORMAT" = "%2$@ and %1$@ have invited you to play Monopoly"; Localizations.bundle inside xcode project

我添加了位于图像fr.lproj,es.lproj,en.lproj等的任何文件夹中。

我还检查我的设备在设置中是否具有正确的配置 - >一般 - >语言和地区 - >英语

我还注意到Localizable.strings是本机ios应用程序中的文件,位于混合应用程序中的文件是messages.strings

我有什么步骤吗?

我会感激任何建议

1 个答案:

答案 0 :(得分:1)

经过研究我找到了添加Localization.string文件和语言的方法,这个链接帮助我更多地了解它https://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014,我按照步骤进行了比较,然后我比较了我的混合应用程序然后 然后我添加了文件夹和文件在战略位置,这是有效的。 结构如下enter image description here

enter image description here