Page 1 of 1

SOLVED: iPhone app, allowing music to continue playing from Apple Music or Spotify

Posted: Mon Apr 13, 2020 10:42 am
by gstarox
SOLVED (I hope it works when I publish App Store): https://livecode.fandom.com/wiki/Iphonesetaudiocategory
Use command

Code: Select all

on preOpenStack 
iphoneSetAudioCategory "ambient"
end preOpenStack 
I've made a workout timer app for iphone that has some sound cues eg mp3 files counting down "3,2,1" and saying "Rest" at appropriate times.
When people workout they probably want to listen to some music alongside the apps sound cues.
But as soon as any mp3 file is played on the app, my Apple Music or Spotify music stops immediately.
Is there any way around this?

I have definitely seen other iphone workout apps (eg BT lite) that allow for music to continue in the background with the app sound cues as well.

Thankyou,

Gee

Mac Catalina Version 10,15,3
iPhone X IOS 13,3,1
LiveCode 9,6,0 (dp3)
Xcode 10,1 & 11,3

Re: iPhone app, allowing music to continue playing from Apple Music or Spotify

Posted: Tue Apr 14, 2020 5:12 am
by gstarox
Someone mentioned multi-threading is what I'm looking for?
Basically, the app sounds don't interrupt Apple Music/Spotify playing.
Or is there some way I can put Spotify/Apple music controls into the app itself?

Re: iPhone app, allowing music to continue playing from Apple Music or Spotify

Posted: Tue Apr 14, 2020 11:53 am
by bogs
Well, far as I know, the verdict on multi-threading in Lc is still no way, although how you would perform that kind of problem without it is beyond my abilities.

Re: iPhone app, allowing music to continue playing from Apple Music or Spotify

Posted: Wed Apr 22, 2020 12:34 pm
by gstarox
bogs wrote:
Tue Apr 14, 2020 11:53 am
Well, far as I know, the verdict on multi-threading in Lc is still no way, although how you would perform that kind of problem without it is beyond my abilities.
I don't know why this was so hard to find but eventually this worked
https://livecode.fandom.com/wiki/Iphonesetaudiocategory

Code: Select all

on preOpenStack 
iphoneSetAudioCategory "ambient"
end preOpenStack