Flutter – How to solve “Missing Purpose String in Info.plist File”

Step 1: Check your email to see if your app really needs the listed permissions. In the email, Apple will list all the purpose strings we need to provide in the Info.plist. Below is an example:

Dear Developer,

We identified one or more issues with a recent delivery for your app, “XXX” 1.0.0 (1). Your delivery was successful, but you may wish to correct the following issues in your next delivery:

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 NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, …


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 NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, …


As you can see, they mention clearly the keys, if your app uses those permissions. You just simply open your Xcode, then copy those keys to your Info.plist and provide the purpose strings.

Step 2: If you are using flutter-permission-handler package, in the email from Apple, you will see many strange permissions that you even don’t know. In this case, you have to add below script to your Podfile (Uncomment – remove # – the permissions you don’t need).

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        ## dart: PermissionGroup.calendar
        # 'PERMISSION_EVENTS=0',

        ## dart: PermissionGroup.reminders
        # 'PERMISSION_REMINDERS=0',

        ## dart: PermissionGroup.contacts
        # 'PERMISSION_CONTACTS=0',

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

        ## dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=0',

        ## dart: PermissionGroup.speech
        'PERMISSION_SPEECH_RECOGNIZER=0',

        ## dart: PermissionGroup.photos
        # 'PERMISSION_PHOTOS=0',

        ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
        # 'PERMISSION_LOCATION=0',
   
        ## dart: PermissionGroup.notification
        # 'PERMISSION_NOTIFICATIONS=0',

        ## dart: PermissionGroup.mediaLibrary
        # 'PERMISSION_MEDIA_LIBRARY=0',

        ## dart: PermissionGroup.sensors
        # 'PERMISSION_SENSORS=0'
      ]
    end
  end
end


Now, it’s time to rebuild your app and upload to Testflight.

If you still have problem after above steps. Please add your comment below or contact us. We are happy to help!

Tagged : / / / /
5 6 votes
Article Rating
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Adnan Kazi
Adnan Kazi
1 month ago

Thanks it works but now i am getting NSCalendarsUsageDescription error but it is not on pod file what should i do ?

Last edited 1 month ago by Adnan Kazi
2
0
Would love your thoughts, please comment.x
()
x