Reputation: 571
I have a quick question, does anyone knows of any other way in iOS 9 and above, to be able for an app to access the microphone in background, except to use the "Audio" Background Mode?
Also the app is not recording the audio, it is just processing in order to try and recognize the audio that is received through the microphone, and to provide notification to the user.
I am asking this question, since I have used "Audio Background Mode" in version 1 of the app, and continued using "Audio Background Mode" in version 2 (update), but when i try to submit the version 2 to App store, they are rejecting it and explaining that App Version 2, is not in compliance of 2.16 because recording audio is not proper use of Audio Background Mode, and i am not recording audio.
Thanks in advance.
Upvotes: 3
Views: 5843
Reputation: 7637
You can't achieve what you want without adding 'audio' value for UIBackgroundModes key. The media framework uses this value to prevent app being suspended when it's going in background.
From what you say your app is falling into: Audio recording apps
category. So, Apple have no reason to reject your app. Try to contact App Review team or in iTunes Connect in App Review Information
there is a Notes
field where you can provide additional information used by review team, write there some explanations of how your app works in background.
Upvotes: 1
Reputation: 634
You're saying that you're app has access to microphone in background, right? System doesn't know if you're recording audio or just processing audio, and it doesn't matter because the mere fact that you have access to microphone in background is already enough.
Your app has to tell the system explicitly that it will use some features in the background. Why?
Declaring the services lets the system know which services you use, but in some cases it is the system frameworks that actually prevent your application from being suspended. https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW23
I.e. if your app doesn't declare that it will use microphone in the background, the system will simply suspend your app because it thinks that there's no need for your app to be active. If your app gets into the App Store in the current state, your app may get suspended in the background (when it really shouldn't), which leads to bad user experience. So, I think, there's no way you will get into the App Store without explicitly declaring that your app uses microphone in the background.
How can you do that?
Support for some types of background execution must be declared in advance by the app that uses them. In Xcode 5 and later, you declare the background modes your app supports from the Capabilities tab of your project settings. Enabling the Background Modes option adds the UIBackgroundModes key to your app’s Info.plist file. Selecting one or more checkboxes adds the corresponding background mode values to that key. Table 3-1 lists the background modes you can specify and the values that Xcode assigns to the UIBackgroundModes key in your app’s Info.plist file.
I hope this answers your question.
Upvotes: 1