Giter VIP home page Giter VIP logo

Comments (6)

d85rawat avatar d85rawat commented on July 17, 2024

Hi,
Could you please provide any solution for the above issue? as still I am struggling for it.

Thanks.

from cordova-plugin-firebase-authentication.

power-cut avatar power-cut commented on July 17, 2024

@d85rawat did you need to set specific dependencies ? TIA

from cordova-plugin-firebase-authentication.

rajeshzmoke avatar rajeshzmoke commented on July 17, 2024

Is there a solution for this problem.. currently experiencing this issue
-RN 0.51.0
-react native Firebase 3.2.0

from cordova-plugin-firebase-authentication.

chemerisuk avatar chemerisuk commented on July 17, 2024

Might be related #11

from cordova-plugin-firebase-authentication.

chemerisuk avatar chemerisuk commented on July 17, 2024

Use https://github.com/chemerisuk/cordova-plugin-firebase-authentication#onauthstatechangedcallback in the latest v0.13.2, to be notified on instant verification or auto verify on Android.

from cordova-plugin-firebase-authentication.

adirzoari avatar adirzoari commented on July 17, 2024

I already have this issue. how can I solve it?

`  confirmPhone = async (phoneNumber) => {
        return new Promise((res, rej) => {
            firebase.auth().verifyPhoneNumber(phoneNumber)
                .on('state_changed', async (phoneAuthSnapshot) => {
                    switch (phoneAuthSnapshot.state) {
                    case firebase.auth.PhoneAuthState.AUTO_VERIFIED:
                        await this.confirmCode(phoneAuthSnapshot.verificationId, phoneAuthSnapshot.code, phoneAuthSnapshot)
                        res(phoneAuthSnapshot)

                        break

                    case firebase.auth.PhoneAuthState.CODE_SENT:
                        // await userSettings.set(AUTH_KEYS.VERIFICATION_ID, phoneAuthSnapshot.verificationId)
                        UserStore.setVerificationId(phoneAuthSnapshot.verificationId)
                        res(phoneAuthSnapshot)
                        break

                    case firebase.auth.PhoneAuthState.AUTO_VERIFY_TIMEOUT: // or 'timeout'
                        UserStore.setVerificationId(phoneAuthSnapshot.verificationId)
                        res(phoneAuthSnapshot)


                    case firebase.auth.PhoneAuthState.ERROR:
                        UserStore.setErrorConfirmationCode(phoneAuthSnapshot.error)
                        rej(phoneAuthSnapshot)
                        break

                    }
                })
        })
    }

    confirmCode = async (verificationId, code, phoneAuthSnapshot) => {
        UserStore.setCodeInput(code)
        try{
            const credential = await firebase.auth.PhoneAuthProvider.credential(UserStore.verificationId, code)
            UserStore.setUserCredentials(credential.token)
            AppStore.setAlreadyRegister(true)
            this.authenticate(credential)
            return credential
        }catch(e){
            console.log(e)
        }
    }

    authenticate = (credential) => {
        firebase.auth().signInAndRetrieveDataWithCredential(credential)

    }
`

from cordova-plugin-firebase-authentication.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.