我正在尝试使用firebase_auth.
但是,每当我调用时,verifyPhoneNumber("+256XXXXXXXXXX")我都会收到A network error (such as timeout, interrupted connection or unreachable host) has occurred.来自PhoneVerificationFailed回调的错误消息。出于这个原因,无法收到短信。
我试过了;
将如下所示的网络权限添加到我的文件中(我的互联网连接正常,因为我可以通过模拟器使用 Google)
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
检查我的 API 密钥的有效性
我很困惑为什么 Flutter 无法与 firebase 通信。我有两个问题。
我的implimentatioin如下;
import 'package:firebase_auth/firebase_auth.dart';
FirebaseAuth auth = FirebaseAuth.instance;
var message;
// fire this when Phone verification is completed
final PhoneVerificationCompleted verificationCompleted =
(AuthCredential phoneAuthCredential) {
auth.signInWithCredential(phoneAuthCredential);
message = 'Received phone auth credential: $phoneAuthCredential';
print(message);
};
// fire this when Phone …Run Code Online (Sandbox Code Playgroud) 假设我有一个盒装数组,例如;
\n\xe2\x94\x8c\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x90\n\xe2\x94\x821\xe2\x94\x822\xe2\x94\x823\xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x94\x98\nRun Code Online (Sandbox Code Playgroud)\n如何将其转换为普通数组,例如1 2 3?