Hi Rajeev,
I'm able to send push notifications to my device. But when i click on that notification it just opens the app. No message is shown inside the app.
Code used by me:
if (application.applicationState == UIApplicationStateActive) {
NSString *cancelTitle = @"Close";
NSString *showTitle = @"Show";
NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Some title"
message:message
delegate:self
cancelButtonTitle:cancelTitle
otherButtonTitles:showTitle, nil];
[alertView show];
[alertView release];
} else {
//Do stuff that you would do if the application was not active
}
But unable to show my message with the help of above code. Above code only works when my app is open that is in foreground state than only this alert gets displayed else not.
Please help.
Thanks.