fix(mobile): request camera permission on iOS to avoid blank screen - #637
Conversation
|
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. |
|
Thanks for opening this pull request. This PR has been automatically classified based on the files modified. Applied Labels
Primary Review Area
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! |
CI — All Checks PassedBackend — SKIP
Mobile — PASS
Web — SKIP
Last updated: |
blankirigaya
left a comment
There was a problem hiding this comment.
fixes issues on IOS which was not tested previously
|
Congratulations @Nareshkumawat-star on getting PR #637 merged! Thank you for your contribution to the project. To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the #get-labels channel on our Discord server and share your merged PR link. |
Summary
This PR resolves the iOS camera permission handling issue in the mobile QR scanner screen. Previously, when the camera permission status was undetermined (
-1), the screen assumed permission was granted and mounted the nativeCameracomponent. If the user subsequently denied permission in the iOS system dialog, the scanner area stayed blank without showing any error feedback or prompt to re-enable permissions in settings.With this change, permission is requested programmatically first. If denied, the UI correctly transitions to a placeholder screen with a button that triggers a settings redirect dialog.
Closes : #610
Type of Change
What Changed
apps/mobile/src/screens/ScanScreen.tsx:Linking,AppState,AppStateStatus, andNativeModulesfromreact-native.checkInitialCameraPermissionfunction to check status and prompt for authorization programmatically usingRNCameraKitModuleif status is undetermined (-1).requestCameraPermissionto show a user-friendly alert on iOS if permissions are denied, with a redirect link directly to iOS App Settings.AppStatelistener to automatically re-evaluate camera permission status when the user returns to the app from iOS Settings.errvariable inhandleSaveQR.How to Test
Checklist
npm run lintpasses).npm run typecheck --workspaces --if-present).npm run test --workspaces --if-present).console.logor debug statements left in the code.