I use this code to create local notification:
UILocalNotification *notification=[[UILocalNotification alloc]init];
notification.soundName = @"new_friend_request.mp3";
notification.repeatInterval = 0;
notification.alertAction = @"Go to";
notification.userInfo = [NSDictionary dictionaryWithObject:@"actionNotification" forKey:@"actionNotification"];
notification.alertBody = @"Body";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
[notification release];
But after pressing home button, I don’t see the notification alert body text on the home screen of iPhone.
At the very beginning I thought, that the notification is not called, but then I used debug and found out, that the notification is called properly.
So, I don’t know, why it doesn’t work.
The problem was that Local notificatons were turn off for my application in iphone settings. Now I still use presentLocalNotification and everything is working.
My application always live in background, because my app uses sockets.
But anyway, sorry for wasting the time of people, who tried to help me, because the problem was due to me.