저는 iOS App에서 푸시 알림을 처리하기 위해 UrbanAirship을 사용하고 있습니다. UAPushNotificationDelegate 구현하고 싶습니다. 여기 appdelegate 내 코드입니다.Urbanairship 대리인이 작동하지 않습니다.
//Appdelegate.m
UAConfig *config = [UAConfig defaultConfig];
[UAirship takeOff:config];
[[UAirship push] updateRegistration];
[UAirship push].userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
[UAirship push].autobadgeEnabled = YES;
[UAirship push].userPushNotificationsEnabled = YES;
PushHandler *pushHandlerDelegate = [[PushHandler alloc] init];
[UAirship push].pushNotificationDelegate = pushHandlerDelegate;
여기 내 PushHandler.h 파일
// PushHandler.h
@interface PushHandler : NSObject<UAPushNotificationDelegate>
@end
가 그럼 난 내 구현 파일
- (void)receivedForegroundNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Call the completion handler
completionHandler(UIBackgroundFetchResultNoData);
}
- (void)launchedFromNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
// Call the completion handler
completionHandler(UIBackgroundFetchResultNoData);
}
- (void)launchedFromNotification:(NSDictionary *)notification actionIdentifier:(NSString *)identifier completionHandler:(void (^)())completionHandler {
// Call the completion handler
completionHandler()
}
- (void)receivedBackgroundNotification:(NSDictionary *)notification actionIdentifier:(NSString *)identifier completionHandler:(void (^)())completionHandler {
// Call the completion handler
completionHandler()
}
- (void)receivedBackgroundNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Call the completion handler
completionHandler(UIBackgroundFetchResultNoData);
}
에 UrbanAirship 방법을 구현하지만 푸시를받을 때 기능의 비 호출하는 것입니다. 내가 어디에서 잘못하고 있니?
안녕하세요. 해결책을 찾았습니까? –