Files
self/app/ios/Podfile
Nesopie 537b0dd418 fix: gracefully gate passport OCR camera permission (#2008)
* fix(app): gate passport OCR camera in TS to stop Android permission loop (SELF-2645)

Denying the camera system prompt on the Android passport OCR scan screen
previously re-fired the prompt repeatedly (the UI "blinked") because the
native CameraFragment re-requested permission from onResume each time the
permission dialog dismissed. On iOS the scanner view silently stayed black
after denial. Both were caused by permission handling living in the native
layer with no TypeScript gate.

Move the gate to TypeScript:
- Pre-navigation check in DocumentOnboardingScreen routes denials to a
  KYC fallback via useKycLauncher instead of navigating into the camera.
- DocumentCameraScreen tracks permission in a cameraReady state and skips
  the <PassportCamera> render until confirmed granted; AppState foreground
  transitions re-check and dismount on revocation. This eliminates the
  iOS black scanner view entirely.

The broken native Android permission code (CameraFragment onResume +
inverted hasCameraPermission()) is now unreachable dead code. Cleaning it
up is tracked as a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(ios): link Camera permission handler in Podfile (SELF-2645)

Without `setup_permissions(["Camera"])` in the Podfile, the iOS app has
the react-native-permissions JS wrapper but no native handler linked, so
`check(PERMISSIONS.IOS.CAMERA)` throws and the passport OCR gate falls
through to the "Camera not available" alert on real iPhones with working
cameras.

Run `cd app/ios && pod install` after pulling this commit. The matching
Podfile.lock update will land in a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* update lock file

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
2026-04-22 07:55:52 -07:00

13 KiB
Executable File