ios - How to detect Push notification when app is open -


this question has answer here:

in application have used push notification service problem when close app @ time notification appears when open application , send notification notification not come. please me.

you can easily handle function mentioned below in appdelegate.m

---implement application:didreceiveremotenotification:

example:-

- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo  {      uiapplicationstate appstate = [application applicationstate];     if (appstate == uiapplicationstateactive)     {              uialertview *alertvw = [[[uialertview alloc] initwithtitle:@"notify" message:yourmessage delegate:self cancelbuttontitle:@"done" otherbuttontitles: @"vizllx", nil] autorelease];              [alertvw show];     }     else {         // push notification received while app in background     } } 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -