Vepa Sabyrow
Vepa Sabyrow

Reputation: 301

ITMS-90683: Missing Purpose String in Info.plist NSMicrophoneUsageDescription, flutter

I don't use microphone but App Store rejected my app by this error:

ITMS-90683: Missing Purpose String in Info.plist - Your app‘s code references one or more APIs that access sensitive user data. The app‘s Info.plist file should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details,

And I added NSMicrophoneUsageDescription to Info.plist but when I upload it gives this error again.

Upvotes: 5

Views: 6577

Answers (5)

Emaborsa
Emaborsa

Reputation: 2850

I had the same problem with my flutter app, did not use any microphone options. I did some research and figured out that a library I was using, had as dependency a library which included the microphone access. Switched to its core version, which hasn't that dependency, the functionality of my app remained the same, on google nothing changed and iOS accepted it without the need of specifing NSMicrophoneUsageDescription.

The lilbrary was the flutter_widget_from_html which included the fwfh_just_audio. Moving to the flutter_widget_from_html_core fixed it.

Upvotes: 7

Michał Sułek
Michał Sułek

Reputation: 287

Comment from library that I'm using, you can do the same:

This plugin contains APIs for accessing all of your phone's audio hardware.

When submitting your app to the app store, it will detect that this plugin contains microphone-related APIs and will require you to add an NSMicrophoneUsageDescription key to your Info.plist file explaining why your app needs microphone access.

If your app does indeed use the microphone, you can add this key to your Info.plist as follows:

<key>NSMicrophoneUsageDescription</key>
<string>... explain why the app uses the microphone here ...</string>

But if your app doesn't use the microphone, you can pass a build option to this plugin to "compile out" microphone code so that the app store won't ask for the above usage description. To do so, edit your ios/Podfile as follows:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    
    # ADD THE NEXT SECTION
    target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'AUDIO_SESSION_MICROPHONE=0'
      ]
    end
    
  end
end

Upvotes: 0

Gal Bracha
Gal Bracha

Reputation: 20011

In my case I was using Permission Handler lib on flutter.

I needed to set everyone of those permissions in the macro to 0

## dart: PermissionGroup.camera
'PERMISSION_CAMERA=0',
...

Then to clean and rebuild

Full discussion is available here

Upvotes: 2

Kamil Komnacki
Kamil Komnacki

Reputation: 456

The Kashik answer has one disadvantage. User will see permission dialog, if some library makes request for microphone.

If you want to find out what library can fire request for microphone, you can search Microphone phrase on every library in .pub-cache directory. And then you can replace such lib. See my answer for more details: https://stackoverflow.com/a/75309325/5985886

Upvotes: 5

Kaushik Chandru
Kaushik Chandru

Reputation: 17752

Even though you are not using microphone some of the packages that you used might have accessed this feature. In info.plist you can add the same like this

<key>NSMicrophoneUsageDescription</key>
<string>The application does not use this feature</string>

Upvotes: 13

Related Questions