Skip to content

[🐛] Bug Report Title - Phone verification on Android returns empty error #8463

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

Open
1 of 5 tasks
yvrublevskiy opened this issue Apr 10, 2025 · 1 comment
Open
1 of 5 tasks

Comments

@yvrublevskiy
Copy link

Issue

Getting empty error while initiating phone verification.
Here's the code snippet

import auth from '@react-native-firebase/auth';

await auth()
.verifyPhoneNumber(phoneNumber)
.on('state_changed', (phoneAuthSnapshot) => {
switch (phoneAuthSnapshot.state) {
case auth.PhoneAuthState.CODE_SENT:
update({ verificationId: phoneAuthSnapshot.verificationId });
router.navigate('/auth/phone-verification');
break;
case auth.PhoneAuthState.ERROR:
logger.error(phoneAuthSnapshot);
break;
}
});

This line logger.error(phoneAuthSnapshot); outputs {"code":null,"error":{},"state":"error"}
It's hard to understand what's wrong from the output. Could you, please, help?

Environment

Click To Expand

react-native info output:

 System:
  OS: macOS 15.3.2
  CPU: (12) arm64 Apple M3 Pro
  Memory: 121.67 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.11.11.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12550806
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • ^21.0.0
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y & ~5.3.3


@MichaelVerdon
Copy link
Collaborator

I have not been able to reproduce the issue. I want to ask you if you can try get more native logs by just console.log() the error. Have you also made sure to follow setup instructions here? https://firebase.google.com/docs/auth/flutter/phone-auth?hl=en&authuser=0 You can probably try recreate the implementation there. Let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@yvrublevskiy @MichaelVerdon and others