Reputation: 21
In my application I have an actionable notification button. I want functionality such that when the notification is triggered and when you press the button the app should open and take you specific view controller.
I have tried this same functionality with simple notification ie notification without button it works fine as below method is called and app opens
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
but when I try to do with actionable notification ie pressing button below method is called but app remains in background
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler
I have been trying very hard since few days but could find the solution.
Please help me....
Thanks
Upvotes: 0
Views: 556
Reputation: 1776
Set the UserNotificationAction's
activationMode
property to UIUserNotificationActivationModeForeground
notificationAction.activationMode = UIUserNotificationActivationModeForeground;
Upvotes: 2