Hi! I’ve migrated my app to use EAS (works great!), but audio still stops playing in my standalone/TestFlight builds if the screen is turned off or the app is backgrounded. My code is pretty straightforward and follows Expo’s instructions:
SDK Version: 42 / Platforms: iOS
app.json:
{
"expo": {
"ios": {
"infoPlist": {
"UIBackgroundModes": [
"audio"
]
}
}
}
}
Initialize audio in app:
await Audio.setAudioModeAsync({
staysActiveInBackground: true,
allowsRecordingIOS: false,
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS,
playsInSilentModeIOS: true,
shouldDuckAndroid: true,
interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS,
playThroughEarpieceAndroid: false,
});
eas.json:
{
"build": {
"base": {
"releaseChannel": "42"
},
"release": {
"ios": {
"env": {
"ENVIRONMENT": "production"
}
},
"android": {
"env": {
"ENVIRONMENT": "production"
},
"buildType": "app-bundle"
},
"extends": "base",
"distribution": "store"
}
}
}
Is there something I’m missing? i.e., do I need to set up the infoPlist
options in eas.json
as well? Thanks in advance for your help!