Skip to content

bug: signInWithPhoneNumber() timeout is always at 60, cannot set another value #906

@boblepepeur

Description

@boblepepeur

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Functions
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Version

7.3.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

I try to disable SMS-Retrieval, doc say to put timeout to 0

When I make that, it doesnt change, SMS-Retrieval continue to work

[https://firebase.google.com/docs/reference/android/com/google/firebase/auth/PhoneAuthOptions.Builder#setTimeout(java.lang.Long,java.util.concurrent.TimeUnit)]

Expected behavior

I debug Android part and timeout option from typescript is never set to android native plugin, timeout is ever set to 60 due to a bad conversion.

await FirebaseAuthentication.signInWithPhoneNumber({ phoneNumber: this.phoneNumber, timeout: 0 })
I fix manually the native plugin in FirebaseAuthenticationPlugin.java at ligne 748 by replacing by
Long timeout = call.getInt("timeout", 60).longValue();

Reproduction

https://github.com/boblepepeur/capacitor-auth-timeout/tree/main

Steps to reproduce

  1. On android
  2. Connect your firebase project if need
  3. In capacitor-welcome.js, set a phone at ligne 32
  4. In android studio set a break point after FirebaseAuthenticationPlugin.java at ligne 748
  5. You will see that timeout is always at 60 because of getLong method, getLong try to convert a Long from a json, it can only by an Int for Java, so it take default value

Other information

No response

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 7.4.3
@capacitor/core: 7.4.3
@capacitor/android: 7.4.3
@capacitor/ios: 7.4.3

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/core: 7.4.3
@capacitor/cli: 7.4.3
@capacitor/android: 7.4.3

[success] Android looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions