diff --git a/types/index.d.ts b/types/index.d.ts index d47e9f857..b88eb8787 100755 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -158,11 +158,46 @@ export interface FirebasePlugin { error?: (err: string) => void ): void verifyPhoneNumber( - success: (value: object) => void, + success: (value: object | boolean) => void, + error: (err: string) => void, + phoneNumber: string, + opts?: { + timeOutDuration: number, + fakeVerificationCode: string, + requireSmsValidation: boolean + }, + ): void + enrollSecondAuthFactor( + success: (value: object | boolean) => void, error: (err: string) => void, phoneNumber: string, - timeOutDuration: number, - fakeVerificationCode?: string + opts?: { + displayName: string, + credential: { + verificationId: string, + code: string + }, + timeOutDuration: number, + fakeVerificationCode: string, + requireSmsValidation: boolean + }, + ): void + verifySecondAuthFactor( + success: (value: object | boolean) => void, + error: (err: string) => void, + params: { + selectedIndex?: number, + credential?: { + verificationId: string, + code: string + }, + }, + opts?: { + timeOutDuration: number, + fakeVerificationCode: string, + phoneNumber: string, + requireSmsValidation: boolean + }, ): void setLanguageCode( lang: string, diff --git a/www/firebase.js b/www/firebase.js index 09672b931..518050e40 100644 --- a/www/firebase.js +++ b/www/firebase.js @@ -271,14 +271,14 @@ exports.didCrashOnPreviousExecution = function (success, error) { // Authentication -exports.verifyPhoneNumber = function (success, error, number, opts) { +exports.verifyPhoneNumber = function (success, error, phoneNumber, opts) { if(typeof opts !== 'object') opts = {}; exec(function(credential){ if(typeof credential === 'object'){ credential.instantVerification = ensureBoolean(credential.instantVerification); } success(credential); - }, error, "FirebasePlugin", "verifyPhoneNumber", [number, opts]); + }, error, "FirebasePlugin", "verifyPhoneNumber", [phoneNumber, opts]); }; exports.enrollSecondAuthFactor = function (success, error, number, opts) {