natsu1211/Alarm-ios-swift

Sound doesn't repeat on lock screen, only plays once

Closed this issue · 3 comments

So I downloaded the project and love it except for the fact that when the alarm is set and the phone is locked, the sound only plays once. Any idea how to fix this?

As far as I know, there is no way to repeat the notification sound when app is on background without hacking (with the limitation of public API, the playing time of notification sound cannot longer than 30 secs), since Apple used some private API to achieve that. I believe Apple keep the APIs private because they really do not want developers to do that.

So if I had a sound play that was of length 2 minutes, Apple would reject the app all together?

I mean notification sound (even if you have set a 2 minutes soundtrack, only the the first 30 seconds will be played), if you have a app like music player, there will no limitation. But if you find a way to play the notification sound longer than 30 secs, your app will highly likely be rejected.