2

In my application i have used push notification service but my problem is that when i close the app at that time the notification appears but when i open the application and then send the notification the notification not come. please help me.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Hitendra
  • 1,610
  • 1
  • 15
  • 22

1 Answers1

1

You can easily handle by this function mentioned below in your 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 is in background
    }
}
Vizllx
  • 9,135
  • 1
  • 41
  • 79