iOS Push Notifications Flow -


i'm working on push notification flow not getting how handle it. need simple explanation, when push notification comes which delegate called

1. when user tap on push notification label
2. when user tap on app icon when push notification comes

please me because i'm unable maintain app application state me flow should like

  1. when user tap on push notification label : should open particular viewcontroller
  2. when user tap on app icon when push notification comes : should open same viewcontroller app goes in background

how can achieve in xcode 8.1/ios 10.1.1.

also i'm using background mode remote notification , background fetch

thanks

in appdelegate.m used check user tap icon

- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo {     //handle notification when user click while app running in background or foreground.     if(application.applicationstate == uiapplicationstateinactive) {          nslog(@"inactive - user has tapped in notification when app closed or in background");         //do tasks       }     else if (application.applicationstate == uiapplicationstatebackground) {          nslog(@"application background - notification has arrived when app in background");      }     else {         nslog(@"application active - notication has arrived while app opened");          //do tasks       }   } 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -