我正在使用UrbanAhiphip处理iOS应用中的推送通知。我想实现UAPushNotificationDelegate。这是我在appdelegate的代码。不能使用的楼梯代表
//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);
}
但是,当我收到一个推送的功能不被调用。我在哪里做错了?
您好。你找到了解决方案吗? –