When my app is in foreground or inactive then upon receiving push notification, I can click on it and the desired action occurs. If I kill the app then upon tapping a notification the app comes to the home screen. Handling Push Notifications when App is Terminated from this post I understood that this is the desired behavior.
I also have 2 actionable buttons attached on my notification. if I click on one of them then I am not redirected to the home screen and the app loads indefinitely! Is there a work around to make the user come to the home screen?
Methods implemented by me which dont get executed after the app is killed and i receive a notification
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler
(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
Also, I read on the posts that after the app is killed and if I click on a notification then didFinishLaunchingWithOptions is executed. I added logger statement in my method but i dont receive them. Any pointers are appreciated.