Skip to content

Commit 607ca6b

Browse files
committed
Fix phone auth deprecated methods usage.
1 parent 6ff9625 commit 607ca6b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: auth/testapp/src/common_main.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ using ::firebase::auth::kAuthErrorInvalidCredential;
4343
using ::firebase::auth::kAuthErrorInvalidProviderId;
4444
using ::firebase::auth::kAuthErrorNone;
4545
using ::firebase::auth::OAuthProvider;
46+
using ::firebase::auth::PhoneAuthOptions;
4647
using ::firebase::auth::PhoneAuthProvider;
4748
using ::firebase::auth::PhoneAuthCredential;
4849
using ::firebase::auth::PlayGamesAuthProvider;
@@ -601,8 +602,10 @@ extern "C" int common_main(int argc, const char* argv[]) {
601602
"Phone Number", "Please enter your phone number", "+12345678900");
602603
PhoneListener listener;
603604
PhoneAuthProvider& phone_provider = PhoneAuthProvider::GetInstance(auth);
604-
phone_provider.VerifyPhoneNumber(phone_number.c_str(), kPhoneAuthTimeoutMs,
605-
nullptr, &listener);
605+
PhoneAuthOptions options;
606+
options.phone_number = phone_number;
607+
options.timeout_milliseconds = kPhoneAuthTimeoutMs;
608+
phone_provider.VerifyPhoneNumber(options, &listener);
606609

607610
// Wait for OnCodeSent() callback.
608611
int wait_ms = 0;
@@ -634,7 +637,7 @@ extern "C" int common_main(int argc, const char* argv[]) {
634637
LogMessage(".");
635638
}
636639
if (listener.num_calls_on_code_auto_retrieval_time_out() > 0) {
637-
const Credential phone_credential = phone_provider.GetCredential(
640+
const PhoneAuthCredential phone_credential = phone_provider.GetCredential(
638641
listener.verification_id().c_str(), verification_code.c_str());
639642

640643
Future<User>phone_future =

0 commit comments

Comments
 (0)