Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

local notification in IOS5 - how to make it pop on the screen and not in the notification center?

i have an application that use the Local notification. now when the IOS5 is out and the notification alert is show - it goes to the notification center and now showing me the alert with my 2 buttons (show and cancel).

can someone please help me figure it, so i can make it pop up in the screen and not in the notification center (the line in the top of the screen).

this is my code:

 UILocalNotification *localNotif = [[UILocalNotification alloc] init];

                localNotif.fireDate=[NSDate date];
                localNotif.timeZone = [NSTimeZone defaultTimeZone];


                localNotif.alertBody = @"Application alerted";

                localNotif.alertAction = @"Show";

                localNotif.soundName = UILocalNotificationDefaultSoundName;
                localNotif.applicationIconBadgeNumber = 0;
                [[UIApplication sharedApplication]presentLocalNotificationNow:localNotif];
                [localNotif release];

Thanks, Amir.

like image 561
Amir Foghel Avatar asked Feb 23 '23 18:02

Amir Foghel


1 Answers

Only the user itself can configure how notification alerts will be presented. Users can also disable notifications for an app or ban them from notification center. There is no developer API for that.

like image 81
Felix Avatar answered Apr 09 '23 00:04

Felix