Trying to implement Firebase Phone Auth with the FirebaseX plugin, I encountered an issue. Here is the code snippet I used:
async getVerificationCode(): void {
const res:any = await this.firebaseX.verifyPhoneNumber('+16505553434', 60);
}
However, I received the following error message:
Expected 3-4 arguments, but got 2.ts(2554) index.d.ts(347, 96): An argument for 'phoneNumber' was not provided.
"@ionic/angular": "5.1.1",
"@ionic-native/firebase-x": "^5.26.0",
"firebase": "7.15.0",
Does anyone have any insight on how to correctly use this function?
Here is the API documentation:
> verifyPhoneNumber(success: (value: string | object) => void, error:
> (err: string) => void, phoneNumber: string, timeoutDuration?: number): Promise<any>;
> /**
> * Signs the user into Firebase with credentials obtained using verifyPhoneNumber().
> * See the Android- and iOS-specific Firebase documentation for more info.
> * @param {object} credential - a credential object returned by the success callback of an authentication method
> * @param {function} success - callback function to call on successful sign-in using credentials
> * @param {function} error - callback function which will be passed a {string} error message as an argument
> */