私のアプリでは、アラーム機能を使用しています。正常に動作していますが、シミュレーターでテストしているときに、ポップアップ ボックスでアラームが通知されます。実際のデバイスでは、ポップアップ ボックスではなくステータス バーに通知として表示されます。
実機でポップアップボックスを探しています。ここで何が間違っているのかわかりませんか?
このコードをアラームに使用しています
[[UIApplication sharedApplication] cancelAllLocalNotifications];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = date;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = alarmMessage;
localNotification.alertAction = NSLocalizedString(@"View", nil);
localNotification.repeatInterval = NSDayCalendarUnit;
/* Here we set notification sound and badge on the app's icon "-1"
means that number indicator on the badge will be decreased by one
- so there will be no badge on the icon */
NSString *ringtonename = [lblRingToneName text];
NSString *extension = @".caf";
NSString *ringtone = [[NSString alloc]initWithFormat:@"%@%@", ringtonename, extension];
localNotification.soundName = ringtone;
localNotification.applicationIconBadgeNumber = -1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
助けてくれてありがとう