Question

I'm making a alarm to ios. wanted to use local notification to schedule and pass the alarm sound.

the current code is something like:

UILocalNotification *localNotification = [[UILocalNotification alloc] init]; /
[localNotification setFireDate:fireDate];
[localNotification setAlertAction:@"View"]; 
[localNotification setAlertBody:[alertBodyField text]]; 
[localNotification setHasAction: YES]; 
[localNotification setSoundName:@"sound.wav"];
[localNotification setApplicationIconBadgeNumber:[[UIApplication sharedApplication] applicationIconBadgeNumber]+1]; 
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; 

in iOS 5.0 works well, as I want a window appears in the middle of the screen with buttons and remains there until there is user interaction

in iOS 6.0 the notification went to the top of the screen and do not allow the existence of buttons. Anyone know with this change?

Was it helpful?

Solution

This is not possible via code. Only the user can change the way a notification is presented to him/her.

The default is at the top of the screen a banner, the alert style in available only if the user choices to use it.

Notification settings Facebook app

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top