stripe-react-native
stripe-react-native copied to clipboard
Improving Scan card permission check
Is your feature request related to a problem? Please describe. Somewhat yes. It is related to https://github.com/stripe/stripe-react-native/issues/210
Describe the solution you'd like
I have an expo app using stripe-react-native. When I click on "Scan card" while adding a payment method, it opens up the scan area where it shows "To scan your card, allow camera access in settings"
Previously, I requested users camera permissions for something else in the app, so I didn't see this message, but I no longer ask for any access to the camera, so now I see it.
I believe that if users were previously not asked for camera permissions (at least in ios), the settings for the app will not show the option to grant that permission. But regardless, it's not a nice way to handle it
I would assume that when clicking the "Scan card" button, the plugin will first check for current camera permissions. If never asked, it will request it. If previously denied, show that message, or better yet show another pop up with the same message but a button click to go to the settings screen for the current app
I could integrate this logic into https://github.com/stripe/stripe-react-native#stripe-initialization but that's not really appropriate either.