NSCameraUsageDescription not working (infoPlist iOS)

Not sure what’s going on here, but apparently my NSCameraUsageDescription no longer works. Updates to my app are being rejected from the store because apparently the description is not showing up within’ the modal.

Here’s my set up.

SDK Version 37.0.0
“expo”: “^37.0.0”,
“expo-cli”: “^3.20.5”,
“expo-permissions”: “~8.1.0”,

Please save me!

Hey @tyfoods,

Are you able to reproduce this with either a TestFlight build or a Sim build? You can run expo build:ios -t simulator and open up the app on your simulator to see if the appropriate message string is being displayed in the permission dialog.

Cheers,
Adam

Thank you for your response. Yes, I did reproduce this on a sim build, and it’s not working. The location permission message shows up, but not the camera permission message.

-Ty

Hey Ty, thanks for taking the time to look into this. We’ll take a look into this.

In the interim, if you haven’t already, upgrading to SDK38 and seeing if the dialog message works might be worth a shot.

Greetings Adam!

I upgraded to SDK38, and built for simulator then gave it a test, but unfortunately, it was unsuccessful. Very strange. Perhaps this points to something wrong with the build process…?

Please keep me updated! For now, I’ve created a custom modal that pops up before asking for camera permission. Hopefully I can get Apple to accept this.

Best,
Ty

Hi all, I’ve also just been bitten by this - I’ve got the following text in app.json, and it worked on SDK 37, but having upgraded to SDK 38, my app was rejected by Apple because the text was the default one:

    "ios": {
      "infoPlist": {
        "NSCameraUsageDescription": "Sweet needs camera permisions to allow you to post photos.",
        "NSPhotoLibraryAddUsageDescription": "Sweet needs photo library permissions to allow you to post photos."
      }
    },

Is there a workaround to the problem in the meantime?

I’m embarrassed to say that I was using the WRONG infoPlist key! Apparently Apple didn’t catch it on the previous updates to the app. So, I thought I was using the correct InfoPlist Key up until this update. First, check if you’re using the right infoPlist key! Apple might have missed that.

I should have used the NSPhotoLibraryAddUsageDescription rather than the NSCameraUsageDescription. However, yes I think there is a work around that you can try.

const cameraRollPermissionModal = ()=>{
        return new Promise((resolve)=>{
          Alert.alert(
            `Camera roll permissions please!`,
            `This app uses your camera to create custom profiles.`,
            [
              {
                text: 'Okay',
                onPress: () =>{
                    resolve();
                },
              },
            ],
            { cancelable: false }
          );
        })
    }

Basically, you can try using this as a “Modal” before the native modal actually asks for permission. This way the required permission information is present.

Good luck!

Happy to hear you got things sorted out @tyfoods. No need to be embarrassed we’ve all banged our heads against a wall with a bug or error only to realize the fix was something simple and obvious haha.

Best of luck with your project moving forward!

2 Likes