-
Notifications
You must be signed in to change notification settings - Fork 197
feat: add native QR scanner support for mobile app #11516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- Add openNativeQRScanner() function to mobileMessageHandlers.ts - Modify QrCodeScanner.tsx to detect mobile environment and use native scanner - Web component shows loading spinner while native scanner is active - Hand off QR scanning to native expo-camera implementation for better reliability
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
gomesalexandre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed worky with mobile-app fren 🐐
| if (isMobile && isNativeScannerLoading) { | ||
| return ( | ||
| <SlideTransition> | ||
| <DialogHeader> | ||
| <DialogHeader.Left> | ||
| <DialogBackButton onClick={onBack} /> | ||
| </DialogHeader.Left> | ||
| <DialogHeader.Middle> | ||
| <DialogTitle>{translate('modals.send.scanQrCode')}</DialogTitle> | ||
| </DialogHeader.Middle> | ||
| </DialogHeader> | ||
| <DialogBody> | ||
| <Center minHeight='298px'> | ||
| <Spinner size='xl' color='blue.500' /> | ||
| </Center> | ||
| </DialogBody> | ||
| </SlideTransition> | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a world where the users didn't update the app, we need to use useMobileFeaturesCompatibility with the next minor version of the mobile app (just take current +1 minor, I'll push a PR for that) and skip this loader and the message logic if the current mobile app isn't compatible
Description
Adds support for native QR code scanning when running in the mobile app. When the web app detects it's running inside the ShapeShift mobile app WebView, it delegates QR scanning to the native
expo-cameraimplementation instead of using the web-basedhtml5-qrcodelibrary.Issue (if applicable)
Closes #11418
Risk
Low Risk
This change only affects QR scanning behavior when running inside the mobile app WebView. Desktop/browser users are unaffected - the existing
html5-qrcodeimplementation continues to work as before.The mobile detection uses the existing
isMobileflag fromglobals.tswhich checks forwindow.isShapeShiftMobile.None. This is a UI/UX change only - no on-chain transactions or wallet interactions are modified. The scanned QR data is passed through unchanged.
Testing
Desktop browser testing (verify no regression):
Mobile app testing (app fren): Ensure the QR code scanner works in:
juicedue to local host constraints)Engineering
👆
Operations
👆
Screenshots (if applicable)
ScreenRecording_12-23-2025.15-41-07_1.MP4