나는 매일 UILocalNotification을 repeatInterval =로 일정을 잡았지만 특정 알림 (예 : 내일 이후 알림)을 취소하고 싶습니다. 내가 할 수 있을까?반복되는 특정 반복 UILocalNotification을 취소하는 방법?
-1
A
답변
1
0
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [[NSDate date] dateByAddingTimeInterval:100];
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
이제 추가 한 모든 알림을 나열합니다.
-(void)localNotifcationList{
UIApplication *app = [UIApplication sharedApplication];
NSArray *eventArray = [app scheduledLocalNotifications];
for (int i=0; i<[eventArray count]; i++)
{
UILocalNotification* yourEventSequence = [eventArray objectAtIndex:i];
NSDictionary *userInfoCurrent = yourEventSequence.userInfo;
NSString *uid=[NSString stringWithFormat:@"%@",[userInfoCurrent valueForKey:@"uid"]];
//Based on your userinfo cancel particular notification.
// You can also compare fire date here
}
이 코드가 작동되기를 바랍니다.
관련 문제
- 1. UILocalNotification을 등록 취소하는 방법
- 2. 시간에 따라 UILocalNotification을 취소하는 방법
- 3. 특정 요일에 UILocalNotification을 반복하십시오.
- 4. 특정 일에 UILocalNotification을 반복하는 방법
- 5. 사용자가 알림을 여러 번 x했을 때 모든 UILocalNotification을 취소하는 방법?
- 6. 특정 상태에서 popState를 취소하는 방법
- 7. SpriteKit에서 특정 SKAction.movebyX를 취소하는 방법?
- 8. TestCase에서 특정 TestStep을 취소하는 방법
- 9. asp.net을 사용하여 페이팔 반복 구독을 취소하는 방법?
- 10. 반복 내에서 반복되는 변수의 각 반복 값을 호출하는 방법
- 11. 알람 관리자에서 반복되는 작업을 취소하는 방법은 무엇입니까?
- 12. 이 반복 알람을 취소하는 방법은 무엇입니까?
- 13. 특정 날짜의 반복 지불
- 14. iCalendar에서 반복되는 빠른 반복 시간
- 15. Orbeon 반복되는 부분의 반복 색인
- 16. 반복되는 빼기에 의한 반복 모듈?
- 17. 특정 날짜에 반복 UILocalNotification
- 18. 매일 UILocalNotification을 발사하지만 특정 시간에 매일
- 19. 스위프트에서 UILocalNotification을 클릭 할 때 특정 ViewController를 시작하는 방법
- 20. UILocalNotification을 덮어 쓰거나 업데이트하는 방법
- 21. uipicker에서 특정 행을 선택 취소하는 방법
- 22. 추가 데이터를 추가하면 특정 알람을 취소하는 방법
- 23. 특정 DGV 셀의 확인란을 선택 취소하는 방법
- 24. 특정 알람을 취소하는 방법은 무엇입니까?
- 25. 데이터베이스에서 반복 이벤트 모델링 및 UILocalNotification을 사용하여 이벤트 발생
- 26. django-merchant로 반복 결제를 취소하는 방법은 무엇입니까?
- 27. 이미 전달 된 UILocalNotification을 닫으시겠습니까?
- 28. 특정 범위 내에서 반복되는 날짜 찾기
- 29. AudioSource.PlayScheduled() 호출을 취소하는 방법
- 30. android에서 이벤트 취소하는 방법
UIApplication.shard(). scheduledLocalNotifications'에서 예정된 알림을 반복하고 각 알림에서 'fireDate'를 확인하십시오. 'fireDate'가 취소하려는 것과 일치하면 알림을 제거하십시오. – Wes
@Wes "scheduledNotifications"에서 단 하나의 알림입니다. 미래의 알림이 없기 때문에 나는 해고를 비교할 수 없습니다. – Gikas