CleverTap / CTNotificationContent

A Notification Content Extension class to display custom content interfaces for iOS 10 push notifications
MIT License
14 stars 7 forks source link

"View In App" action button tap does not open app. #6

Closed kishoretheju closed 5 years ago

kishoretheju commented 5 years ago

"View In App" action button tap not invoking callback function -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler

I tried by changing [UNNotificationAction actionWithIdentifier:@"action_3" title:@"View In App" options:UNNotificationActionOptionNone]

to

[UNNotificationAction actionWithIdentifier:@"action_3" title:@"View In App" options:UNNotificationActionOptionForeground]

Tapping on "View In App" should open invoke the callback for me to handle the deeplink right? Am i missing something here.

Aditi3 commented 5 years ago

Hey @kishoretheju

CleverTap provides a callback that you can implement in your Notification Content Extension subclass to get user event type data.

The following code snippet will be useful:

// optional: implement to get user event type data
- (void)userDidPerformAction:(NSString *)action withProperties:(NSDictionary *)properties {
    NSLog(@"user did perform action: %@ with props: %@", action , properties);
}

Hope it helps.

kishoretheju commented 5 years ago

I will try it and get back.

kishoretheju commented 5 years ago

@Aditi3 How do i pass the action data to app? Basically i am trying to open the app with the deeplink of push notification when user selects "View In App"

kishoretheju commented 5 years ago

Got it, had to put to the same deeplink url in call to action url for the button.

Aditi3 commented 5 years ago

Awesome, thanks for letting us know.