Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepAliveInBackground=true option is not functioning as expected on iOS (on Production) #99

Closed
mschoi-ian opened this issue Feb 2, 2025 · 2 comments · Fixed by #103
Closed

Comments

@mschoi-ian
Copy link

mschoi-ian commented Feb 2, 2025

Hi, thanks a lot for maintaining this great package.

Description:

keepAliveInBackground=true option is not functioning as expected on iOS (on Production) with the specified configuration.
When the app transitions to the background state, the recording stops immediately.
The recording resumes once the app returns to the foreground.

Expected behavior:

The recording task should continue to operate seamlessly, regardless of whether the app is in the foreground or background.

Steps to reproduce:

  • Version: @siteed/expo-audio-stream: 1.11.4
  • recordingConfig
const recordingConfig: RecordingConfig = {
    interval: chunkDuration,
    channels: 1,
    keepAwake: true,
    pointsPerSecond: 1,
    enableProcessing: true,
    autoResumeAfterInterruption: true,
    onAudioStream: processRecording
}
  • configuration on app.json
[
    "@siteed/expo-audio-stream",
    {
        "enablePhoneStateHandling": true,
        "enableNotifications": true,
        "enableBackgroundAudio": true,
        "iosBackgroundModes": {
            "useVoIP": false,
            "useAudio": false,
            "useProcessing": true
        },
        "iosConfig": {
            "backgroundProcessingTitle": "Audio Recording",
            "keepAliveInBackground": true
        }
    }
]
@mschoi-ian mschoi-ian changed the title The keepAliveInBackground option is not functioning as expected on iOS (on Production) keepAliveInBackground=true option is not functioning as expected on iOS (on Production) Feb 3, 2025
@mschoi-ian
Copy link
Author

On iOS (on production build):

When useVoIP: true and useAudio:true, recording in the background worked on the device.
However, the app could not be accepted due to the app store guidelines (the relevant feature issue: #85)

When useVoIP: false and useAudio:false, although the app was successfully accepted on the app store,
recording in the background did not work on the device.

Other related options were like the following:
• version: @siteed/expo-audio-stream: 1.11.4
• recordingConfig

...
keepAwake: true,
enableProcessing: true,
autoResumeAfterInterruption: true,
showNotification: false
...

• app.json

[
    "@siteed/expo-audio-stream",
    {
        "enablePhoneStateHandling": true,
        "enableNotifications": true,
        "enableBackgroundAudio": true,
        "iosBackgroundModes": {
            "useProcessing": true,
            ...
        },
        "iosConfig": {
            "backgroundProcessingTitle": "Audio Recording",
            "keepAliveInBackground": true
        }
    }
]

@mschoi-ian
Copy link
Author

mschoi-ian commented Feb 6, 2025

On Android (on production build):

showNotification=true: Recording in the background works on the device. (No review issue on the play store)
showNotification=false: Recording in the background does not work on the device. (No review issue on the play store)

Other related options were like the following:
• version: @siteed/expo-audio-stream: 1.11.4
• recordingConfig

...
keepAwake: true,
enableProcessing: true,
autoResumeAfterInterruption: true,
...

• app.json

[
    "@siteed/expo-audio-stream",
    {
        "enablePhoneStateHandling": true,
        "enableNotifications": true,
        "enableBackgroundAudio": true,
        "androidConfig": {
            ... (default)
        }
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant