最近、ローカル通知を含むクライアント用のアプリを作成しました。元のバージョンでは、通知はまったく問題なく機能していました。しかし、クライアントが別のバージョンをリリースしようとしたときに、コードを変更せずにイメージと DB リソースのみを変更すると、通知が機能しなくなりました。現在、コードをデバッグしようとしていますが、何も見つかりませんでした。すべて問題ないようですが、通知はありません。一方、以前のビルドを実行すると、完全に機能します。何が問題なのか教えてください。ありがとうございました。
NSTimeInterval diffTimeIntervalSinceNow = timeInterval; //time-interval after which notification should appear
UILocalNotification *localNotification = [[UILocalNotification alloc] init]; //Create the localNotification object
[localNotification setFireDate:[NSDate dateWithTimeIntervalSinceNow:diffTimeIntervalSinceNow]]; //Set the date when the alert will be launched using the date adding the time the user selected on the timer
//[localNotification setRepeatInterval:notificationInterval];
[localNotification setAlertAction:@"Launch"]; //The button's text that launches the application and is shown in the alert
[localNotification setAlertBody:alertBody]; //Set the message in the notification from the textField's text
[localNotification setHasAction: YES]; //Set that pushing the button will launch the application
[localNotification setApplicationIconBadgeNumber:[[UIApplication sharedApplication] applicationIconBadgeNumber]+1]; //Set the Application Icon Badge Number of the application's icon to the current Application Icon Badge Number plus 1
[[UIApplication sharedApplication] cancelAllLocalNotifications];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; //Schedule the notification with the system
[localNotification release];
それが私が使ってきたコードです。しかし、これは以前のバージョンで動作していたコードとまったく同じです。