私は、iOSアプリケーションでプッシュ通知を処理するUrbanAirshipを使用しています。私はUAPushNotificationDelegateを実装したいと思います。ここで私のコードはappdelegateです。機能のUrbanairship delegate not working
//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
それから私は私の実装ファイルにUrbanAirshipメソッドを実装し
- (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);
}
しかし、非、私はプッシュを受けたときに呼び出しています。どこが間違っていますか?
こんにちは。あなたは解決策を見つけましたか? –