Add React Native remote verification sample app#297
Open
avner-m wants to merge 6 commits into
Open
Conversation
Add a new react-native-remote-verification-tutorial sample (starter and complete) demonstrating the remote app-to-app OID4VP / ISO 18013-7 Annex B verification flow with the Mobile Credential Verifier React Native SDK. Rename the existing react-native-mdocs-verifier-tutorial to react-native-in-person-verifier-tutorial to distinguish it from the new remote sample.
The post-build "Installing ..." step crashed on physical iPhones
(macOS + Xcode 17 / iOS 18+) with:
TypeError: Cannot convert object to primitive value
at LockdowndClient.startSession
Expo CLI's bundled legacy USB-device installer logs
`debug(`startSession: ${pairRecord}`)`. The template forces a string
conversion of the lockdown pair record, a null-prototype object with no
toString/valueOf, so it throws. The debug package evaluates the template
eagerly even when logging is disabled, failing on every run before the
device handshake.
Patch LockdowndClient.js to format the object lazily
(`debug('startSession: %o', pairRecord)`) and persist it with
patch-package so it survives yarn install. Applied to both the starter
and complete tutorial apps.
- Add patch-package devDependency and postinstall hook
- Add patches/@expo+cli+55.0.32.patch (pinned to resolved version)
- Commit yarn.lock for reproducible installs
iOS and Android each require their own MATTR VII verifier application because the redirect URI registered on the application must match that platform's URL scheme. Replace the single APPLICATION_ID placeholder with IOS_APPLICATION_ID and ANDROID_APPLICATION_ID, and resolve Constants.APPLICATION_ID for the current platform via Platform.OS.
Replace the example bundle identifier, package name, and URL scheme with empty placeholders so users supply their own values when following the tutorial. Add a scheme placeholder to the starter app.config.ts.
requestMobileCredentials resolves to an OnlinePresentationSessionResult that has no isSuccess field. Branching on `!session.isSuccess` ran the failure path on every call, including successful verifications, then dereferenced session.error (undefined on success) and threw TypeError: Cannot read property 'message' of undefined, so results never displayed. Check session.error, the SDK's actual failure signal, instead.
Reword the scheme, bundle identifier, and package name comments to plain "update this" instructions for users following the tutorial.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new React Native sample app for the remote (app-to-app) mDoc verification flow, and renames the existing React Native in-person verifier sample for clarity.
This is the second of two PRs. The companion PR adds the matching React Native sections to the tutorial and quickstart in
mattr-learn.Changes
react-native-remote-verification-tutorial/(-starterand-complete) — a verifier app that uses@mattrglobal/mobile-credential-verifier-react-nativeto verify an mDoc presented from a wallet on the same device via OID4VP / ISO 18013-7 Annex B.initializewithplatformConfiguration.tenantHost, thenrequestMobileCredentials(docType, namespaces,applicationId,challenge).Linkinglistener callinghandleDeepLink.Openid4VpCallbackActivity, declared via a newwithOpenid4VpCallbackActivityExpo config plugin (bound to{package}://oid4vp-callback).withMobileCredentialAndroidVerifierSdkadds the native Android SDK Maven repo.react-native-mdocs-verifier-tutorial/→react-native-in-person-verifier-tutorial/(the existing proximity/in-person sample), so the in-person and remote React Native samples are clearly distinguished.Testing
esbuildtranspile of all TS/TSX in the new app: passes.node --checkon both Expo config plugins: passes.🤖 Generated with Claude Code