0

I am working on interactive notifications. I want user to perform atleast one action when notification get fired. but If in case user does not perform any action and directly tap on notification then app get launched.

I want to handle this like displaying alert that time when app launch.

does anyone have idea for that?

Parth Pandya
  • 1,460
  • 3
  • 18
  • 34

1 Answers1

0

Check if app is launching via taping notification. Write following in

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

      if (launchOptions)
     {
           NSDictionary * appLaunchDict = [[NSDictionary alloc]initWithDictionary:launchOptions];

           NSDictionary* userInfo = [appLaunchDict objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
           if (userInfo){
           // Call your method here which will show alert or any thing you want.
           }
     }
}
MOHAMMAD ISHAQ
  • 988
  • 7
  • 15