【发布时间】:2023-01-25 09:11:15
【问题描述】:
我想使用 appwrite 在我的 flutter 应用程序上启用电话身份验证。我遵循了官方指南,更改了 appwrite 的 .env 变量并使用 docker compose up -d 以正确的凭据重新启动 appwrite。作为 SMS 提供商,我使用 text-magic 因此我的 .env 文件具有以下 SMS 配置:
_APP_SMS_PROVIDER=sms://[USERNAME]:[API-KEY]@text-magic
_APP_SMS_FROM=+123456789
用户名和API-Key来自textmagic
此外,我创建了一个简单的方法来创建电话会话。
createPhoneSession(String phonenumber) async {
try {
Client client = Client();
client
.setEndpoint(AppConstants.endpointId)
.setProject(AppConstants.projectId);
Account account = Account(client);
var token = await account.createPhoneSession(userId: ID.unique(), phone: phonenumber);
print(token.$id);
} catch (error) {
print(error);
}
}
我得到的异常如下:
I/flutter ( 5195): AppwriteException: null, Connection timed out (0)
有什么建议为什么它会超时吗?提前谢谢你的帮助!
【问题讨论】:
-
基本上我为我的appwrite连接使用了错误的IP地址......