Skip to content

Add React Native remote verification sample app#297

Open
avner-m wants to merge 6 commits into
masterfrom
rn-remote-verification-sample
Open

Add React Native remote verification sample app#297
avner-m wants to merge 6 commits into
masterfrom
rn-remote-verification-sample

Conversation

@avner-m
Copy link
Copy Markdown
Contributor

@avner-m avner-m commented Jun 3, 2026

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

  • New: react-native-remote-verification-tutorial/ (-starter and -complete) — a verifier app that uses @mattrglobal/mobile-credential-verifier-react-native to verify an mDoc presented from a wallet on the same device via OID4VP / ISO 18013-7 Annex B.
    • initialize with platformConfiguration.tenantHost, then requestMobileCredentials (docType, namespaces, applicationId, challenge).
    • iOS redirect handled via a Linking listener calling handleDeepLink.
    • Android redirect handled by the SDK's Openid4VpCallbackActivity, declared via a new withOpenid4VpCallbackActivity Expo config plugin (bound to {package}://oid4vp-callback).
    • withMobileCredentialAndroidVerifierSdk adds the native Android SDK Maven repo.
  • Rename: 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

  • esbuild transpile of all TS/TSX in the new app: passes.
  • node --check on both Expo config plugins: passes.
  • Not run end-to-end on device (requires SDK access + physical device + a configured tenant).

🤖 Generated with Claude Code

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.
@avner-m avner-m requested a review from a team as a code owner June 3, 2026 01:12
avner-m added 5 commits June 3, 2026 15:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant