[Camera Plugin] How to add "NSLocationAlwaysAndWhenInUseUsageDescription"?
camera-plugin
Mobile icon
Forge component by Platform Maintenance
Application Type
Mobile

Hello,

I'm using camera plugin and location plugin in my mobile apps. Generated the iOS and use Transporter to submit for the TestFlight. I received the following errors:


ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “xxxx.app” bundle should contain a NSLocationAlwaysAndWhenInUseUsageDescription 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, visit:

In my camera plugin, I already configured it like this: 

"variables": [{

            "name": "LOCATION_WHENINUSE_USAGE_DESCRIPTION",

            "value": "We access your location to improve your experience."

        },

        {

            "name": "CAMERA_USAGE_DESCRIPTION",

            "value": "We access your camera to take pictures."

        },

        {

            "name": "PHOTOLIBRARY_USAGE_DESCRIPTION",

            "value": "We access your photo library to load or save pictures."

        }]


May I know how to configure for "NSLocationAlwaysAndWhenInUseUsageDescription"? 


Thanks in advance,

KZO

Hi,

Replace the code with below

"variables": [{

            "name": "LOCATION_WHENINUSE_USAGE_DESCRIPTION",

            "value": "We access your location to improve your experience."

        },

{               

 "name":"NSLocationAlwaysAndWhenInUseUsageDescription",               

 "value":"We access your location to improve your experience. "  

 },

        {

            "name": "CAMERA_USAGE_DESCRIPTION",

            "value": "We access your camera to take pictures."

        },

        {

            "name": "PHOTOLIBRARY_USAGE_DESCRIPTION",

            "value": "We access your photo library to load or save pictures."

        }]


It won't show the error. Thanks

Regards
Balaji Chandran

Hi Balaji Chandran,

Tried it according to your suggestion. But not work. Still the same error.

Thanks & Regards,
KZO

Hi,

May I know your MABS version? Also can you try generating your app after changing the extensibility configuration with recent MABS version? Because if you change extensibility configuration file then app needs to be regenerated.

Regards
Balaji Chandran

Hi Balaji Chandran,

MABS 9.0 and Camera Plugin also latest from forge. Yes. I even republish all consumer modules before generating the iOS apps. 

Hi,

Are you trying this for the first time or you did regeneration earlier? Also may i know at which point is the error coming? During generation of app or Transporter? Because if its coming in transporter then there should be some config changes to be done while doing MobileAppGeneration. 


Hi,

Forgot to tell you one more thing. The code which I sent you should be added in main App and not in camera plugin. Lets say your appA consuming camera and location plugin, you need to add this code in appA and not in any of the plugin.


"ios": [

            {

                "name": "UseSwiftLanguageVersion",

                "value": "5.3"

            },

            {

                "name":"NSLocationWhenInUseUsageDescription",

                "value":"Your location will be used to enhance experience"

            },

            {

                "name":"NSLocationAlwaysAndWhenInUseUsageDescription",

                "value":"Your location will be used to enhance experience"

            },

            {

                "name":"NSLocationUsageDescription",

                "value":"Your location will be used to enhance experience"

            }

        ]


This should be added under preferences tab of your extensibility configurations under your appA which i mentioned earlier


Yes. When using a transporter for TestFlight. 

I was generated and my apps is in AppStore. For this time, due to Android 12 I updated some forge components including camera plugin.


Noted. Will try and let you know again. Thank you for your suggestion.


Hi Balaji Chandran,

I add the extensibility configurations under my MainApps, and generate and use Transporter for TestFlight, but still the same message from AppStore.

Any other ideas?


Thanks in advance,

KZO


Hi Balaji,

Can you share full json which need to add in main App.

Hi,

I have used Location Plugin with below extensibility configuration. And is working properly. 

But when i added Camera Plugin in my application then i m facing issue. Now i can see default description "User geocoder service". 

I have shared extensibility configuration for both plugins. 

Please help me to resolve this. 

Location Plugin : {

    "plugin": 

    {

        "url": "https://github.com/OutSystems/cordova-plugin-geolocation.git#4.0.1-OS10",

        "variables": [{

            "name": "LOCATION_WHENINUSE_USAGE_DESCRIPTION",

            "value": "App needs access to location to track vehicles in case of emergency and in concern of delivery executive's safety."

        }]

    },

    "metadata": {

        "mabs-min": "7.2.0",

        "name": "Location Plugin",

        "version": "5.1.8"

    }

}

Camera Plugin : 

{

    "plugin":{

        "url":"https://github.com/OutSystems/cordova-plugin-camera#4.2.0-OS41",

"variables":[

         {


            "name":"CAMERA_USAGE_DESCRIPTION",

            "value":"We access your camera to update your profile picture and scan barcodes."

         },

          {

            "name": "LOCATION_WHENINUSE_USAGE_DESCRIPTION",

            "value": "App needs access to location to track vehicles in case of emergency and in concern of delivery executive's safety."

        }            ]

    }

    ,

    "metadata": {

        "mabs-min": "7.2.0",

        "name": "Camera Plugin",

        "version": "7.1.12"

    }

}

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.