预期有3-4个参数,但得到了2.ts FirebaseX Ionic本机插件

问题描述 投票:0回答:1

我需要通过FirebaseX插件使用Firebase Phone Auth。我已经尝试过了:

 async getVerificationCode(): void {

    const res:any = await this.firebaseX.verifyPhoneNumber('+16505553434', 60);

  }

但是它是这样说的:

期望3-4个参数,但得到了2.ts(2554)索引。d.ts(347,96): 未提供“ phoneNumber”的参数。

  "@ionic/angular": "5.1.1",
  "@ionic-native/firebase-x": "^5.26.0",
  "firebase": "7.15.0",

任何线索如何正确使用此功能?

API:

>   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
>      */
angular typescript firebase ionic-framework cordova-plugins
1个回答
0
投票

期望您的参数之前有两个回调。尝试

const res:any = await this.firebaseX.verifyPhoneNumber(() => {}, () => {}, '+16505553434', 60);
© www.soinside.com 2019 - 2024. All rights reserved.