ネット上で質問が見つからない深刻な問題があります。ローカライズされたメッセージをプッシュすると、スウェーデン語でのみ機能し、英語では機能しません。スウェーデンの Iphone 4 の定数のみを表示するという別のものがあります。Iphone 3g でもテストしましたが、私の iPhone 4 と同じ問題があり、英語ではなくスウェーデン語で動作します。
Iphone 4 のポップアップを英語で表示すると、サーバーからの通知で指定したローカリゼーション キーしか取得できません。
Windows Server からプッシュする C# の通知の文字列を次に示します。私のiPhoneアプリの追加パラメータは、どの言語でも問題なく機能するため、プッシュのサーバー側の部分とは何の関係もないようです。
int total = notification.AmountScheduledEvent + notification.AmountCourseResult + notification.AmountExam;
string locKey = (total > 1 ? "PushMessageMultiple" : "PushMessageSingle");
string msg = "{\"aps\":{"+
"\"alert\": {"+
"\"loc-key\":\"" + locKey + "\","+
"\"loc-args\":[\"" + total + "\"]},"+
"\"badge\":" + total + ","+
"\"sound\":\"default\"},"+
"\"amountSchedule\":" + notification.AmountScheduledEvent + ","+
"\"amountCourseResult\":" + notification.AmountCourseResult + ","+
"\"amountExam\":" + notification.AmountExam + "}";
sv.lproj の Localizable.strings で:
/* push stuff */
"PushMessageMultiple" = "%@ nya händelser";
"PushMessageSingle" = "1 ny händelse";
en.lproj の Localizable.strings:
/* push stuff */
"PushMessageMultiple" = "%@ new events";
"PushMessageSingle" = "1 new event";
これは、通知が機能する画面の写真です (スウェーデン語) http://img267.imageshack.us/i/img0014b.png/
これは、通知が機能しない画面の写真です (英語) http://img696.imageshack.us/i/img0015i.png/
メッセージの代わりに定数を取得する理由は何ですか?