I’m developing a chat application for iOS 5. I had a problem with local notifications.
When application went to background state, I am using this code:
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.alertAction = @"Ok";
localNotification.alertBody = [NSString stringWithFormat:@"From: %@\n%@",message.sender,message.message];
[[UIApplication sharedApplication] presentLocalNotificationNow:localNotification];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
but when application is in active state ,and it is not in chat page then also I need the local notification but I used the same code there also
the notification is coming in tray but banners are not coming….
Please help me out…
THe following code handles both remote and local notification