Skip to content

fix(mobile): check camera permission on ios and alert to open setting…#628

Closed
Nareshkumawat-star wants to merge 4 commits into
Dev-Card:mainfrom
Nareshkumawat-star:fix/camera-permission-ios
Closed

fix(mobile): check camera permission on ios and alert to open setting…#628
Nareshkumawat-star wants to merge 4 commits into
Dev-Card:mainfrom
Nareshkumawat-star:fix/camera-permission-ios

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown

Summary

This PR resolves the camera permission issue on iOS. Previously, the QR scanner would display a blank screen with no feedback if the user denied camera permission. We now correctly check the camera permission status on iOS (using RNCameraKitModule directly since Camera is lazy-loaded) and present a user-friendly alert redirecting the user to iOS Settings if access is denied.


Type of Change

  • Bug fix
  • New feature
  • Refactor (no functional change)
  • UI / Design change
  • Tests only
  • Documentation
  • Infrastructure / DevOps
  • Security

What Changed

  • ScanScreen.tsx:
    • Imported NativeModules, Linking, AppState, and AppStateStatus from react-native.
    • Added checkInitialCameraPermission to query iOS camera status via RNCameraKitModule.checkDeviceCameraAuthorizationStatus().
    • Updated requestCameraPermission to handle iOS permission states and trigger a redirect to the Settings app (Linking.openURL('app-settings:')) upon permission denial.
    • Added an AppState listener to re-evaluate permission status and start the scanner immediately when the user returns to the app from iOS Settings.
    • Configured useFocusEffect to verify permissions whenever the Scan tab is focused.

How to Test

  1. Launch the DevCard mobile application on an iOS Simulator or physical device.
  2. Navigate to the Scan DevCard screen.
  3. When the iOS camera permission prompt appears, tap Don't Allow (or deny it beforehand in Settings).
  4. Verify that the camera scanner displays the permission placeholder and shows a dialog explaining how to enable permission with a button that successfully opens the Settings app.
  5. In Settings, enable camera permission for DevCard, return to the app, and verify that the scanner starts working automatically.

#issue : #610

Checklist

  • My code follows the project's coding style (npm run lint passes).
  • TypeScript compiles without errors (npm run typecheck --workspaces --if-present).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (npm run test --workspaces --if-present).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. mobile labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown

Hi @Nareshkumawat-star,

Thanks for opening this pull request.

This PR has been automatically classified based on the files modified.

Applied Labels

  • gssoc:approved
  • mobile

Primary Review Area

  • mobile

Reviewer

@blankirigaya has been identified as the primary reviewer for this pull request.

If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer.

Thank you for your contribution!

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

CI — Checks Failed

Backend — FAIL

Check Result
Lint FAIL
Test FAIL
Typecheck PASS

Mobile — PASS

Check Result
Lint PASS
Test PASS

Web — PASS

Check Result
Build PASS

Last updated: Sun, 21 Jun 2026 17:34:19 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant