简体   繁体   中英

Launch app on using iOS 8 actionable notifications

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

UserNotificationAction's activationMode属性设置为UIUserNotificationActivationModeForeground

 notificationAction.activationMode = UIUserNotificationActivationModeForeground;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM