Skip to content

RNFirebasePhoneauth is not defined Β #1

@eman1000

Description

@eman1000

hie my setup up is like this

import RNFirebasePhoneAuth from "react-native-firebase-phone-auth";
import firebase from './firebase';

class LoginPhone extends React.Component{
  componentDidMount() {
     this.listenToOTP()
  }
  listenToOTP(){
 
         DeviceEventEmitter.addListener('OTPStatus', (data) => {
         
             switch(data.CODE){
                case "SENT":
                        //SMS Sent
                    break;
                case "VERIFIED":
                         //SMS Received & read by google play services
                          let authData = {
                              code : data.OTPNumber,
                              verificationId : data.verificationId
                          }
                          firebase.auth().signInWithPhoneAuth(
                             authData, 
                             (success)=>{ 
                                 //on Successful Login
                             }, 
                             (error)=>{ 
                                 //on Error 
                             });
                     break;
                case "ERROR":
                        //error sending SMS
                    break;
             }
 
             if(data.CODE == "ERROR")
                 {
                 }
 
         });
 
 
     }
     onPressSendOTP(){
          let phoneNumber = "+60166*****";
          RNFirebasePhoneauth.sendOTP(phoneNumber);
     }

I am getting an error "RNFirebasePhoneauth is no defined "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions