通知センターにすべてを設定すると、通知が表示されるので、私のアプリのローカル通知は起動しません。iOS5でローカル通知が機能しない
同じ問題が発生していますか?
より多くの情報:
はXCode 4.1とiOS 4.3 SDKでコンパイルされた数日前に同じソースコードからコンパイル同じアプリは、すべてがうまく動作します。
さらに、旧バージョンのXCodeとiOS SDKでコンパイルされたアプリケーションは、アップグレード後にiOS5でも動作します。
ただし、同じコードでコンパイルされたアプリケーションで、XCode 4.2とiOS5 SDKは動作しません。
ご意見はありますか? iOS5の特別な作業はありますか?
サンプルコードは次のようである:
UIApplication *app = [UIApplication sharedApplication];
NSArray *oldNotifications = [app scheduledLocalNotifications];
// Clear out the old notification before scheduling a new one.
if (0 < [oldNotifications count]) {
[app cancelAllLocalNotifications];
}
// Create a new notification
UILocalNotification *alarm = [[UILocalNotification alloc] init];
if (alarm) {
alarm.fireDate = theDate;
alarm.timeZone = [NSTimeZone defaultTimeZone];
alarm.repeatInterval = NSDayCalendarUnit; //repeat every day
alarm.alertBody = [NSString stringWithFormat:@"alert"];
[app scheduleLocalNotification:alarm];
[alarm release];
}
おかげで、iOSの5で マイケル
APNサービスを有効にするためにアプリIDとSSL証明書も設定する必要がありますか? – user370773
回答ありがとうございます。また、UILocalNotificationDefaultSoundNameはiOS 5.0にいくつか問題があります。 –