こんにちは、私は Google カレンダーに取り組んでいます。イベントの開始時に、ローカル通知でユーザー イベントを維持する必要があります。
そのためには、通知を表示する必要があります。ユーザーが一度に2つのイベントを持っている場合、ローカル通知カウントはアプリアイコンで増加する必要があります. .
アプリ アイコンのローカル通知数を増やす方法を教えてください。
私のコードを確認してください。
//Local notifications delegates and methods.
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [[when startTime] date];
notif.timeZone = [NSTimeZone defaultTimeZone];
// Notification details
notif.alertBody = titles;// here title is the key word for the event
// Set the action button
notif.alertAction = nil;
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
// Specify custom data for the notification
NSDictionary *userDict = [NSDictionary dictionaryWithObject:titles forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
}
ありがとうございました