MRR*_*MRR 3 firebase-authentication flutter-web
情况: 我正在 flutter web 上实现 Firebase 电话登录。在此过程中,我想要自定义由 signInWithPhoneNumber 函数调用的 reCAPTCHA,如Firebase 文档中所述。
final ConfirmationResult confirmationResult = await auth.signInWithPhoneNumber(
phoneNumber, verifier_should_go_here
);
Run Code Online (Sandbox Code Playgroud)
复杂: 我正在尝试实现RecaptchaVerifier,但它有一个名为FirebaseAuthPlatform的必需参数,并且我不知道如何为我的应用程序生成此参数。
问题: 如何创建 RecaptchaVerifier 来传递给 flutter web 上的signInWithPhoneNumber 函数?
3 个简单步骤:
firebase_auth_platform_interface
依赖项添加到您的pubspec.yaml
文件中flutter pub add firebase_auth_platform_interface
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart' show FirebaseAuthPlatform;
RecaptchaVerifier
,您使用FirebaseAuthPlatform.instance
归档时间: |
|
查看次数: |
1046 次 |
最近记录: |