50ButtonsEach/flic2lib-ios

Use Flic2 Button to Play Sounds Even When Using Other Apps

Closed this issue · 2 comments

jh0274 commented

So I love the Flic button! My kids are loving the fart generator, it’s like a 21st century whoopy cushion :)

Question: so far I’ve been able to get my custom app to connect to the Flic and for the Flic button to play an audio file every time the button is clicked. This functionality works while the app is in the foreground and in the background, but not when I’m using another app on iOS. Ordinarily I wouldn’t have expected it to work while using another app but I can see that your demo (fart) function works even while other apps are open.

This is exactly how I’d like my app to work - can you tell me how you guys achieved this?

Thanks

jh0274 commented

Ok I fixed this now, the sound library I was using stops working in the background, I switched to react-native-track-player and it’s working fine. I’d still be interested to know what sound library you’re using. Thanks!

Emill commented

Hi. Glad you got it working!

We are using AVAudioPlayer (https://developer.apple.com/documentation/avfaudio/avaudioplayer) in the Flic app to play sounds.