feat(android): add support for Firebase Phone Number Verification (PNV)#9045
Open
just1and0 wants to merge 11 commits into
Open
feat(android): add support for Firebase Phone Number Verification (PNV)#9045just1and0 wants to merge 11 commits into
just1and0 wants to merge 11 commits into
Conversation
…r Verification (PNV)
## Summary
Adds a new `@react-native-firebase/phone-number-verification` package implementing the Firebase Phone Number Verification (PNV) SDK, which is now Generally Available.
PNV enables carrier-level phone number verification directly from the device's SIM — no SMS required. This is Android-only as the Firebase PNV SDK (`com.google.firebase:firebase-pnv`) has no iOS counterpart.
### API
- `enableTestSession(token)` — enable SIM-less testing with a Firebase Console token
- `getVerificationSupportInfo()` — check if the device's SIM supports PNV
- `getVerifiedPhoneNumber()` — full verification flow (consent UI + carrier check)
- `getDigitalCredentialPayload(nonce)` — for custom flows using Android Credential Manager
- `exchangeCredentialResponseForPhoneNumber(dcApiResponse)` — exchange a Credential Manager JWT for a verified phone number
Both namespaced (`firebase.phoneNumberVerification()`) and modular (`import { getVerifiedPhoneNumber } from '@react-native-firebase/phone-number-verification'`) APIs are supported.
iOS gracefully rejects all calls with an "only supported on Android" error.
Closes #9013
|
|
Contributor
|
Warning Gemini encountered an error creating the summary. You can try again by commenting |
Java formatting: the CI runs a formatter (google-java-format). Keep `rejectPromiseWithCodeAndMessage` calls on a single line — don't break across lines even if it's long.
e2e tests must NOT call `firebase.app()` directly — it triggers `Deprecated API usage detected while in strict mode`. Use the modular `getApp()` or module-specific getters (e.g., `getPhoneNumberVerification()`) instead.
This comment was marked as resolved.
This comment was marked as resolved.
- Remove namespaced API (lib/namespaced.ts, types/namespaced.ts, types/internal.ts) - Remove iOS native stubs (ios/, RNFBPnv.podspec) - Remove web fallback stubs (lib/web/) - Add react-native.config.js with ios: null to disable iOS autolinking - Rewrite modular.ts to call native module directly via getReactNativeModule - Add Platform.OS guard with clear error for non-Android - Remove phoneNumberVerification from KNOWN_NAMESPACES - Update e2e and local tests for standalone modular API
Adds documentation and discoverability for the phone-number-verification package per review feedback. - Add typedoc.json with entry points for API reference generation - Add package to root typedoc.json so `yarn reference:api` includes it - Add sidebar entry in docs.json for docs site navigation - Add docs page with installation, usage examples, testing, and platform handling - Update navigation chain (perf -> pnv -> vertexai) - Add README.md with standard badges and package description - Add CHANGELOG.md with initial entry
mikehardy
requested changes
Jun 11, 2026
Collaborator
There was a problem hiding this comment.
Really quick turn and handled all the code feedback, awesome
- Bit more of a thought on constraining the API to modular-only
- Augment API to expose all native SDK items
- Augment docs to discuss geographic restrictions, error handling, and dev token setup
- Looks like CLA is still blocked
- results from testing on an emulator (showing error unsupported, then test mode success)
- PR description no longer matches the implementation
This comment was marked as resolved.
This comment was marked as resolved.
- Remove getPhoneNumberVerification() convenience wrapper per modular-only API guidance - Remove PhoneNumberVerification interface from types - Rename e2e "iOS unsupported" to "only Android supported" and add Other platform test - Remove YouTube embed from docs (invalid video ID) - Add consent info to docs for getVerifiedPhoneNumber() - Remove convenience object section from docs - Clear CHANGELOG.md to stub for release automation
Bridge all fields from the native Firebase PNV SDK that were previously omitted. VerificationSupportResult now exposes simSlot, carrierId, and reason (mapped to VerificationSupportStatus strings). VerifiedPhoneNumberTokenResult now exposes expirationTimestamp, issuedAtTimestamp, nonce, and claims. Error handling extracts structured error codes from FirebasePhoneNumberVerificationException (9 SDK codes). Added getVerificationSupportInfo(simSlot) overload for querying specific SIM slots. Updated TypeScript types, e2e tests, local test app, and docs with error handling table, fallback examples, test-mode setup, and region/carrier limitations.
fix failing action
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.
Description
Adds a new
@react-native-firebase/phone-number-verificationpackage implementing the Firebase Phone Number Verification (PNV) SDK, which is now Generally Available.PNV enables carrier-level phone number verification directly from the device's SIM — no SMS required. This is Android-only as the Firebase PNV SDK (
com.google.firebase:firebase-pnv) has no iOS counterpart.API:
enableTestSession(token)— enable SIM-less testing with a Firebase Console tokengetVerificationSupportInfo()— check if the device's SIM supports PNVgetVerifiedPhoneNumber()— full verification flow (consent UI + carrier check)getDigitalCredentialPayload(nonce)— for custom flows using Android Credential ManagerexchangeCredentialResponseForPhoneNumber(dcApiResponse)— exchange a Credential Manager JWT for a verified phone numberBoth namespaced (
firebase.phoneNumberVerification()) and modular APIs are supported. iOS gracefully rejects all calls with an "only supported on Android" error.Related issues
Release Summary
Added
@react-native-firebase/phone-number-verification— a new package for Firebase's Phone Number Verification (PNV) SDK. Supports carrier-level phone number verification on Android without SMS.Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/**/e2ejesttests added or updated inpackages/**/__tests__Test Plan
Tested on Android emulator via the manual test component at
tests/local-tests/pnv/pnv-test.jsx:getVerificationSupportInfo()returns successfully with[{"isSupported": false}](expected on emulator with no SIM)fpnvgms: [FpnvImpl] FpnvImpl created)Screen.Recording.2026-06-10.at.14.29.33.mov