2015-01-09 2 views
0

todayViewController에서 쿼리하려고하는데이 확장 프로그램을 실행할 때마다 클라이언트 ID를 설정하라는 요청을 받는다. 그런 다음 AppDelegate.m의 대상 멤버로 확장을 추가했습니다. 그러나 코드 :pfquery in today

[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings]; 
[[UIApplication sharedApplication] registerForRemoteNotifications]; 

콘솔에서 설명한 오류로 연장 잘되지 작동합니다. 그런 다음이 부분에 주석을 달았습니다. 오늘 연장이 실행되지만 아무런 반응이 없습니다. 질문을 추가했습니다.

- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler { 
// Perform any setup necessary in order to update the view. 
completionHandler(NCUpdateResultNewData); 
} 

도와주세요. 도와 주셔서 미리 감사드립니다!

답변

0

오늘 확장명은 [UIApplication sharedApplication]에 액세스 할 수 없으므로 UIApplication 방법을 사용해야하는 코드는 대부분 허용되지 않습니다.

오늘 확장 프로그램이 알림을 등록하는 것은 실제로 많은 의미가 없습니다. 앱을 포함하는 앱 (예 : 앱)에서 수행해야합니다. 두 곳 모두에서 할 필요가 없습니다.