natsu1211 / Alarm-ios-swift

clone of the official IOS clock alarm app written in swift
MIT License
388 stars 116 forks source link

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

Closed dlush315 closed 8 years ago

dlush315 commented 8 years ago

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?

natsu1211 commented 8 years ago

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.

dlush315 commented 8 years ago

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

natsu1211 commented 8 years ago

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.