CustomPushHandler delegate not being called deep linking urban airship

1.1k Views Asked by At

Hello im trying to do the deep linking feature in my app but the callbacks arent being called when i tap on the notification and the app opens. Im following this tutorial: https://support.urbanairship.com/customer/portal/articles/1087599-custom-push-handling-in-ios---deep-linking-from-a-push-notification-to-a-url.

Here´s how it looks like the appDelegate:

customPushHandler = [[CustomPushHandler alloc] init];
[UAPush shared].pushNotificationDelegate = customPushHandler;
UAConfig *config = [UAConfig defaultConfig];
[UAirship takeOff:config];
[UAPush shared].notificationTypes = (UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert 
);
[UAPush setDefaultPushEnabledValue:NO];
[[UAPush shared] setPushEnabled:YES];
[[UAPush shared] resetBadge];

And These are the headers of the CustomPushHandler:

- (void)displayNotificationAlert:(NSString *)alertMessage;
- (void)receivedBackgroundNotification:(NSDictionary *)notification fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler;

- (void)launchedFromNotification:(NSDictionary *)notification fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler;

- (void)receivedForegroundNotification:(NSDictionary *)notification fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler;

The only callback called is displayNotificationAlert that is being called when the app is running. When the app is in background i receive the notification, i tap on it, the app opens but there is no callback called.

I dont know what im doing wrong. Thanks for reading.

1

There are 1 best solutions below

0
On

As suggested by dperconti in the comments:

Enabling remote notifications for the app fixed this for me:

http://docs.urbanairship.com/build/ios_features.html#background-push