getVerifiedPhoneNumber method

  1. @override
Future<Map<String, dynamic>?> getVerifiedPhoneNumber()
override

Runs the full Firebase PNV verification flow.

On Android, this displays the Android Credential Manager consent bottom sheet, letting the user consent to sharing their carrier verified phone number with the app - no SMS code is ever sent. On success, a map containing phoneNumber and token is returned. The token must be forwarded to your backend to be exchanged for a Firebase custom auth token.

Throws a PlatformException on failure (e.g. user declined consent, no network, or unsupported platform/device).

Implementation

@override
Future<Map<String, dynamic>?> getVerifiedPhoneNumber() {
  throw PlatformException(
    code: 'UNAVAILABLE',
    message:
        'Firebase Phone Number Verification (PNV) is not supported on Web.',
  );
}