要登录或注册的Unity Firebase URL在restClient中出现错误



我用Unity学习Firebase并使用RestClient,虽然它只对数据库进行读写操作很好,但在身份验证部分我被卡住了,到目前为止我只测试了注册部分,但它给了我错误http未知,我从Firebase网站的参考文档中获得了url,这是抛出错误的函数,以防有帮助,但我认为我的url错了或其他什么,我对你提供的任何解决方案都持开放态度,谢谢=(:

void signUpUser(string nombreusuario,string email, string password)
{
string datosusuario="{"email":""+email+"","password":""+password+"","returnSecureToken":true}";
RestClient.Post<signresponse>("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=" + AuthKey, datosusuario).Then( ResponseHelper=>
{
localId = ResponseHelper.localId;
idToken = ResponseHelper.idToken;
nombre = nombreusuario;
enviaBaseDatos(true);
}).Catch(error=> 
{
Debug.Log(error);
});
}

所以我一直在挖掘,我认为文档部分错误,因为它说端点是

https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=[API_KEY]

但它也说

您可以通过发出到Auth signupNewUser端点的HTTP POST请求。

所以真正的端点是signUpNewUser,而不是简单的signUp

https://identitytoolkit.googleapis.com/v1/accounts: signUpNewUser?key=[API_KEY]

如果这个新端点不起作用,请尝试端点的版本3:

https://www.googleapis.com/identitytoolkit/v3/relyingparty/signUpNewUser?key=[API_KEY]

最新更新