[android][auth] add support for `ForceResendingToken`, closes #721
This commit is contained in:
parent
91a9c4744c
commit
3668f15244
|
@ -953,7 +953,7 @@ declare module 'react-native-firebase' {
|
|||
*/
|
||||
verifyPhoneNumber(
|
||||
phoneNumber: string,
|
||||
autoVerifyTimeout?: number,
|
||||
autoVerifyTimeoutOrForceResend?: number | boolean,
|
||||
forceResend?: boolean,
|
||||
): PhoneAuthListener;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
import User from './User';
|
||||
import ModuleBase from '../../utils/ModuleBase';
|
||||
import { getAppEventName, SharedEventEmitter } from '../../utils/events';
|
||||
import { isAndroid } from '../../utils';
|
||||
import { isAndroid, isBoolean } from '../../utils';
|
||||
import { getLogger } from '../../utils/log';
|
||||
import { getNativeModule } from '../../utils/native';
|
||||
import INTERNALS from '../../utils/internals';
|
||||
|
@ -376,20 +376,29 @@ export default class Auth extends ModuleBase {
|
|||
* authentication purposes.
|
||||
*
|
||||
* @param phoneNumber
|
||||
* @param autoVerifyTimeout Android Only
|
||||
* @param autoVerifyTimeoutOrForceResend Android Only
|
||||
* @param forceResend Android Only
|
||||
* @returns {PhoneAuthListener}
|
||||
*/
|
||||
verifyPhoneNumber(
|
||||
phoneNumber: string,
|
||||
autoVerifyTimeout?: number,
|
||||
autoVerifyTimeoutOrForceResend?: number | boolean,
|
||||
forceResend?: boolean
|
||||
): PhoneAuthListener {
|
||||
let _forceResend = forceResend;
|
||||
let _autoVerifyTimeout = 60;
|
||||
|
||||
if (isBoolean(autoVerifyTimeoutOrForceResend)) {
|
||||
_forceResend = autoVerifyTimeoutOrForceResend;
|
||||
} else {
|
||||
_autoVerifyTimeout = autoVerifyTimeoutOrForceResend;
|
||||
}
|
||||
|
||||
return new PhoneAuthListener(
|
||||
this,
|
||||
phoneNumber,
|
||||
autoVerifyTimeout,
|
||||
forceResend
|
||||
_autoVerifyTimeout,
|
||||
_forceResend
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue