stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

iOS: NSCameraUsageDescription key required even if not used / card scanning available at all?

Open benomatis opened this issue 3 years ago • 9 comments

Related to #167

@thorsten-stripe I just ran into this as well, I'm being asked to provide a NSCameraUsageDescription key even though I'm not using the camera in my app. However, the message is not coming during a review, so I cannot contact the review team, it's a request for me to add the key, otherwise the build won't end up in App Store Connect at all. I think we should, at the minimum, update the doc to say this key will need to be added no matter what, which this message seems to indicate. Here is the full text:

Dear Developer,

We identified one or more issues with a recent delivery for your app, "App Name" 1.2.3 (45). Please correct the following issues, then upload again.

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 NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. 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. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Best regards,

The App Store Team

benomatis avatar May 13 '21 10:05 benomatis

@thorsten-stripe as an additional question, closely related, is card scanning available at all in iOS (or Android, for that matter)? I see no reference to it in this library even though the key above is set and says "to scan cards" - I read about the feature in the Stripe iOS SDK docs.

benomatis avatar May 13 '21 10:05 benomatis

Card scanning is built-in on iOS — if you set an NSCameraUsageDescription, it'll show a "Scan card" button in PaymentSheet.

This App Store Connect message seems overly-broad: We don't show the card scanning button unless an NSCameraUsageDescription is set, and this check makes it difficult to distribute an SDK with an optional camera feature. It looks like we'll have to split card scanning into a separate component or a compile-time option.

For now, I'd recommend setting the NSCameraUsageDescription to "To scan cards", and we'll look into a way to disable this at compile-time.

davidme-stripe avatar May 14 '21 15:05 davidme-stripe

I have only gotten this message once, when I started using this library, and I did not have the key set. I already set the key, so it's ok, but would be indeed nice if it was optional, though I saw nothing changing in the app, I thought it will ask for permission to use the camera, but it doesn't.

benomatis avatar May 14 '21 15:05 benomatis

The "scan card" button is only in PaymentSheet at the moment, so it won't appear if you built your own card form.

davidme-stripe avatar May 14 '21 15:05 davidme-stripe

oh, ok, I'm using the card form. Is the PaymentSheet the name of the pre-built UI?

benomatis avatar May 14 '21 15:05 benomatis

Yes. Card scanning outside of PaymentSheet is on our roadmap, but we don't have an ETA yet.

davidme-stripe avatar May 14 '21 15:05 davidme-stripe

ok, thank you. So I guess this issue could be used to prevent having to set this key if Camera is otherwise not used in the app?

On Fri, 14 May 2021 at 17:58, davidme-stripe @.***> wrote:

Yes. Card scanning outside of PaymentSheet is on our roadmap, but we don't have an ETA yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stripe/stripe-react-native/issues/210#issuecomment-841334518, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMNSHAAJSCVYTQJDGBDX5DTNVCDLANCNFSM442I7OGA .

benomatis avatar May 14 '21 15:05 benomatis

Yeah, we'll leave this open to track that work.

davidme-stripe avatar May 14 '21 16:05 davidme-stripe

@davidme-stripe thank you for your hard work. can you please give us an update on this issue? is it still open?

rlam3 avatar Sep 02 '22 15:09 rlam3

Perhaps make this requirement more explicit in the stripe docs for eg implementing apple pay on ios? As a newbie to Stripe, I believe I followed the apple pay implementation docs step by step but did not notice this as a requirement.

In general, this is very unexpected to me and it took me a few hours to find the issue because I make no use of the camera and apple does not specify the package that triggers the error. Just happy I stumbled upon this thread relatively quickly…

JuliusHuizing avatar Jan 27 '23 08:01 JuliusHuizing

If using expo, I resolved this issue by adding in app.json { "expo": { "ios": { "infoPlist": { "NSCameraUsageDescription": "This app uses camera to scan." }, }, }, }

zyaanbookee avatar May 16 '23 06:05 zyaanbookee