Hi,
We are creating an app that needs to run a service in the background even when the app is closed.
In order to do this we will ask the users consent and the user can choose to turn this feature ON or OFF at anytime.
While reading the documentation I have found out that we need to use one of the background modes (in our case the audio access) but I can't find an working example.
Can you help?
We are considering of using the Audio background mode because our background service needs to access the microphone.
Do you have an example of how can we create a background service?
Is it this possible to access the microphone from a background service?
Thank you,
Mircea
An app that plays or records audio continuously (even while the app is running in the background) can register to perform those tasks in the background. You enable audio support from the Background modes section of the Capabilities tab in your Xcode project. (You can also enable this support by including the UIBackgroundModes key with the audio value in your app’s Info.plist file.) Apps that play audio content in the background must play audible content and not silence.
Typical examples of background audio apps include:
• Music player apps
• Audio recording apps
• Apps that support audio or video playback over AirPlay
• VoIP apps
When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background. As long as it is playing audio or video content or recording audio content, the app continues to run in the background. However, if recording or playback stops, the system suspends the app.