4

I am working on the alarm application in IOS. Where i want to send the notification when application is in background mode. The sound notification would be like ALARM. i.e sound will not stop until user don't perform any interaction.

We had used the notification but it will play only for 30 seconds. i.e default notification. Is there any other option to notify the user with sound(ALARM).

Thanks in advance.

Maulik
  • 19,348
  • 14
  • 82
  • 137
ios developer
  • 3,363
  • 3
  • 51
  • 111

3 Answers3

4

The alternate work around is , set the repeatInterval property of local notification as NSMinuteCalendarUnit.

localnotification.repeatInterval = NSMinuteCalendarUnit;

Once the user open the application, cancel all notification using

[[UIApplication sharedApplication] cancelAllNotification];

or,

Cancel a particular notification

Community
  • 1
  • 1
KingofBliss
  • 15,055
  • 6
  • 50
  • 72
1

notif.repeatInterval = NSSecondCalendarUnit;

Once user enter into app, make this notification to cancel.

Ramdhas
  • 1,765
  • 1
  • 18
  • 26
0

No, there is no way to play sound more than 30 seconds.

Rather, you can play sound in loop when user opens the app by tapping the notification.

Maulik
  • 19,348
  • 14
  • 82
  • 137