에서 응용 프로그램은 내가 사용 일정 변경 알림을 등록 할 때 점화되지 않음 다음EKEventStore 변경 알림 배경
- (void) registerForLocalCalendarChanges
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(localCalendarStoreChanged) name:EKEventStoreChangedNotification object:self.store ];
}
변경이 로컬 달력을 만든 경우는 다음을 호출해야합니다 :
- (void) localCalendarStoreChanged
{
// This gets called when an event in store changes
// you have to go through the calendar to look for changes
// launch this in a thread of its own!
ashsysCalendarEventReporter *eventReport = [ashsysCalendarEventReporter new];
NSLog(@"Local Calendar Store Changed");
[NSThread detachNewThreadSelector:@selector(getCalendarEvents) toTarget:eventReport withObject:nil];
}
하지만 ... 앱을 시작한 다음 백그라운드로 보내면 캘린더 항목을 변경할 수 있으므로 캘린더 항목을 변경할 때 아무런 변화가 없습니다. 앱으로 돌아 가면 발사됩니다. 그러나 물론 그것은 목적이 아닙니다. ...
@property (strong,nonatomic) EKEventStore *store;
업데이트 내가 배경 가져에게로 가지고있는 물건을 보여 깜빡 :
저장소와 헤더 파일에 정의되어 있습니다.
- (void) application:(UIApplication*) application performFetchWithCompletionHandler:(void (^) (UIBackgroundFetchResult))completionHandler
{
// UIBackgroundTaskIdentifier uploadCalInfo = [application beginBackgroundTaskWithExpirationHandler:nil];
NSLog(@"A fetch got called");
// ashsysCalendarEventReporter *eventReport = [ashsysCalendarEventReporter new];
// [eventReport getCalendarEvents];
// // [NSThread detachNewThreadSelector:@selector(getCalendarEvents) toTarget:eventReport withObject:nil];
// [application endBackgroundTask:uploadCalInfo];
completionHandler(UIBackgroundFetchResultNewData);
performFetch 일부 전혀 달력에 관련된 임의의 시간처럼 보일 무엇 호출됩니다 :
이
은 didFinishLaunchingWithOptions[application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
이 응용 프로그램의 위임에입니다. 백그라운드 가져 오기를 실행하는 것을 찾아내는 방법이 있습니까? 항상 달력입니까? 실제 실행은 주석 처리되어 있습니다 - 정확합니까?
무엇이 누락 되었습니까?