0

I can't find any right solution even after long searching. What is normal scenario in iOS in belows?

When the app gets local notification,

1) didReceiveLocalNotification is invoked when the app is in foreground. and also is invoked when notification banned touched launch.

However, under the same situation,

2) didReceiveLocalNotification method is not invoked by app icon touched launch.

Stackoverflow or Apple document said

in case of 2), applicationWillEnterForeground -> didReceiveLocalNotification -> applicationDidBecomeActive delegates process is normal. but I've never seen didReceiveLocalNotification in the case of touching app icon.

Please, give me an advice case 2) is normal or not. Help me!

Edit - After having couple of comments, I've found a link such as Handling local notifications when the user presses the icon instead of the alert This approach would be working I believe. Thanks.

Edit2 - Local Notification This link would be helpful as well.

Community
  • 1
  • 1
Marcel Kim
  • 91
  • 1
  • 2
  • 8

1 Answers1

0

That method is only called when your app is launched as a result of interacting with a local notification. Not seeing it called during a normal app launch is expected behaviour.

bgilham
  • 5,909
  • 1
  • 24
  • 39
  • Thanks for the quick answer, but I did mean that app icon touched launch under the condition that local notification is being in banner. App icon touched launch is a normal app launch regardless of local notification? – Marcel Kim May 06 '15 at 17:29
  • Your question is unclear at best. That method will be called if you launch the app from a local notification. Otherwise it won't. – bgilham May 06 '15 at 17:30
  • Oh, thanks. then is there any other way to get the local notification information in applicationWillEnterForeground? This would be the last question if you say it's impossible. I think I need to try put notification information into a file if then. Agree it? – Marcel Kim May 06 '15 at 17:38
  • Please just read this and make sure you understand it: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction.html – bgilham May 06 '15 at 17:39
  • Thanks for the reference. But I already understood your answer in your second comment. I've asked another question such that there is any other way to get the local notification information in applicationWillEnterForeground if so. I've tried to get it through scheduledLocalNotifications but failed since the notifications have been fired when applicationWillEnterForeground is invoked by tapping the app icon. Thanks anyway! – Marcel Kim May 06 '15 at 17:56