2012-03-06 3 views
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]; 

答えて

1

いいえ:ここで

は、私は地元の通知を作成しています方法です。ユーザーがあなたのアプリの通知センターをオンにしている限り、あなたが起動したすべてのローカル通知は、通知センターに別個のエントリとして表示されます。それらが同じUILocalNotificationオブジェクトの複数の起動であってもUILocalNotification APIはこれを制御できません。

関連する問題