나는 매우 간단해야하는 빠른 질문이 있습니다.iOS UILocalNotification - 배지 아이콘 및 알림 소리
첫째, 나는 게시 코드에 의해 시작 하겠어 :
-(void)notification
{
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
if (!localNotification)
return;
// Current date
NSCalendar *calendar = [NSCalendar currentCalendar]; // gets default calendar
NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit) fromDate:[NSDate date]]; // gets the year, month, day, hour and minutesfor today's date
[components setHour:19];
[components setMinute:30];
[components setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"EST"]];
localNotification.fireDate = [calendar dateFromComponents:components];
localNotification.repeatInterval = NSDayCalendarUnit;
[localNotification setAlertBody:@"Your 'Daily Quote' is ready!"];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
localNotification.applicationIconBadgeNumber = 1;
localNotification.soundName = UILocalNotificationDefaultSoundName;
}
localNotification가 표시되어 있는지 보이지만, 배지와 소리가 표시되지 및 재생 않습니다. 이것은 "repeatInterval"로 인해 루핑 되었기 때문일 수 있습니까?
어떻게 표시 할 수 있습니까? 알림은 지정된 시간에 표시되지만 배지 아이콘은 변경되지 않습니다.
감사합니다!
헨리
설정 한 후에 알림을 예약합니다 소리와 badeg 아이콘, 그리고 전에하지. – Lefteris
감사! @Lefteris! 간단한 질문, 빠른 응답, 만약 당신이 내가 upvote 및 동의 질문에 대답하고 싶습니다. –
필요 없음. 다행히 도움이되었다 :-) – Lefteris