Bhavesh Lathigara
Bhavesh Lathigara

Reputation: 1415

Local Notification Alert Timing

notificaiton = [[UILocalNotification alloc] init];
notificaiton.fireDate = [NSDate Date];
notificaiton.repeatInterval = 0;
notificaiton.alertBody = @"Alarm";
notificaiton.timeZone = [NSTimeZone defaultTimeZone];
notificaiton.repeatCalendar = [NSCalendar currentCalendar
notificaiton.soundName = @"Alarm.wav"
[[UIApplication sharedApplication] scheduleLocalNotification:notificaiton];

my question is , Local Notification alert stay only for few seconds but, is it possible, local notification alert stay for few minutes?

please any body has answer

Thanks, In Advance

Upvotes: 1

Views: 481

Answers (2)

Sarafaraz Babi
Sarafaraz Babi

Reputation: 480

if you mean that you need to play notification sound more than 30 sec ??? then it is not possible.

you wrote that Local Notification alert stay only for few seconds but check proper that, this stay as per your sound file length.

and this sound file Must be maximum 30 sec in length.

if you will try to give soundName more than 30 sec. then it will play default sound in notification.

find this line

"Sounds that last longer than 30 seconds are not supported. If you specify a file with a sound that plays over 30 seconds, the default sound is played instead." into apple notification doc.

Upvotes: 1

Krishnabhadra
Krishnabhadra

Reputation: 34275

No it is not possible to customize the AlertView and its timings. System does it and we don't have any control over it. We can only customize, the alertbody and title of the action button.

Configure the substance of the notification: alert, icon badge number, and sound.

The alert has a property for the message (the alertBody property) and for the title of the action button or slider (alertAction); both of these string values can be internationalized for the user’s current language preference.

Upvotes: 2

Related Questions