Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom iOS Alarm Clock even possible?

I've been building the past few days a custom alarm clock for Android. So far so good, the alarm fires and I play some remote sound using HTTP streaming (network is of course needed, or else, there is a fallback with local sound). Now it's time take this app to iOS, I'm a total beginner but I'm not afraid to learn Objective-C since the client part is really straightforward. But from what I see, it seems to me it's quite impossible. I would like some help here if possible :

  • In the iOS developers docs I see this "For remote notifications in iOS, you can specify a custom sound that iOS plays when it presents a local or remote notification for an application. The sound files must be in the main bundle of the client application.". This is bad for me, I would like to play 1 to many sounds following each other and for possibly more than 30 seconds. Is there a work around for this?
  • In another question I see "They could be background-capable audio apps (using UIBackgroundModes in the app's plist) and playing silence, using Audio Queues or the RemoteIO Audio Unit, even in the background, until time to mix in some alarm sounds or music.", but someone after that, says AppStore validation doesn't allow that. Is this still accurate?
  • In a general question, is it possible, nowadays (or in a near futur iOS version), to do a simple alarm clock that is able to play remote sounds with no restrictions?

I would appreciate any feedback here, I'm quite disappointed from what I see that this simple feature seems to be impossible to do. Unless I'm mistaken somewhere and I hope someone will give me a hint!

Thx for reading!

like image 244
Battochon Avatar asked Nov 04 '22 02:11

Battochon


1 Answers

I see no way around this since Apple doesn't allow launching apps without user interaction. Although you can change the workflow so that user has to keep the app running (screen can still be locked) for the alarm to work. This is how other alarm apps work.

I suspect the 2nd solution you mentioned wont go well with Apple because it'll drain user's battery. You are taking cpu cycles while not doing anything (playing silence).

like image 174
maroux Avatar answered Nov 13 '22 14:11

maroux