アプリを正常に実行しており、ローカル通知を使用しています。
私は今アプリを国際化することを決定し、デバイスの言語を変更する前に言語に設定された通知を除いて、すべて正常に機能しています。
ローカライズされた文字列を含む配列から通知にメッセージを入力するので、ユーザーがデバイスの言語を変更すると、通知の文字列も変更されると考えましたが、間違っていました。
この問題にどのように取り組むのが最善でしょうか? 私の NSString テキストも NSLocalizationString にする必要がありますか?
私の通知コード:
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = [alertTimes objectAtIndex:i];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
NSString *text = [alertText objectAtIndex:i];
// Notification details
localNotif.alertBody = text;
// Set the action button
localNotif.alertAction = @"View";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 1;
// Specify custom data for the notification
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"someValue" forKey:@"someKey"];
localNotif.userInfo = infoDict;
// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];