1
私は[[UIApplication sharedApplication] scheduleLocalNotification:
ユニーク通知センター内のエントリと「repeatInterval」
UILocalNotification
インスタンス上
repeatInterval
を設定することにより、定期的に(毎分)、ユーザはそれを確認するまでにその通知を繰り返すことになりますローカル通知の警告(iOSの5)を発行しています
'repeatInterval'を設定すると、通知を受け付けない間に通知が繰り返されるたびに、通知センターに別のエントリが表示されます。例:発砲を確認しない5分後に、通知センターに5つの別個の項目がある。
1つのエントリだけを持つ方法はありますが、1分ごとに警告音が鳴りますか?残念ながら
UILocalNotification *localNotify = [[UILocalNotification alloc] init];
localNotify.fireDate = aFireDate;
localNotify.timeZone = [NSTimeZone defaultTimeZone];
localNotify.userInfo = userInfo;
// 3. Configure the substance of the notification: alert, icon badge number, and sound.
localNotify.alertBody = NSLocalizedString(alertTitleText, nil);
localNotify.alertAction = NSLocalizedString(alertActionText, nil);
localNotify.soundName = UILocalNotificationDefaultSoundName;
localNotify.applicationIconBadgeNumber = 1;
localNotify.repeatInterval = NSMinuteCalendarUnit;
// Schedule the local notification for delivery.
[[UIApplication sharedApplication] scheduleLocalNotification:localNotify];