I want play the sound of local notification even if the phone is in silent mode, i have refereed this link for playing the push notification sound in silent mode.
I want to know, can we do the same for the UILocalNotification
also?
Thank you!
There are Local Notifications, allowing apps to play an alarm sound at a specified time. But other than that, local notifications are of very limited usefulness to a sophisticated alarm clock app:
- A local notification does not wake up the app unless the user
interacts with it, giving the app no control when the alarm sounds.
- Alert sounds have a maximum duration of 30 seconds and there is no
way to repeat them automatically. (An app could schedule multiple
local notifications in pre-defined time intervals to simulate a
repeating alert, though.)
- Local notifications cannot override the ring/silent switch or the
device’s Do Not Disturb setting.
- Alert sounds must be located in the app bundle. Users cannot specify
a song from their music library as their alert.
- Apps have no control over the volume of a local notification’s alert
sound (for example, to slowly crank up the volume of the alarm).
Reference Link :
http://oleb.net/blog/2014/02/alarm-clock-apps-ios/