gpt4 book ai didi

firebase - Firebase不会返回用户

转载 作者:行者123 更新时间:2023-12-03 03:49:10 25 4
gpt4 key购买 nike

我有一个与Firebase交互的AuthService类。然后在Signin.dart中,我想获得该用户,但是每次遇到问题时,我都会获得该用户。我收到错误消息,表明Firebase无法发送用户。
错误:

Exception has occurred. PlatformException(PlatformException(firebase_auth,com.google.firebase.FirebaseException: An internal error has occurred.[ Error 403 (Forbidden)!!1

*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7%auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* >body{background:url(//www.google.com/images/errors/robot.png) 100% 5pxno-repeat;padding-right:205px}p{margin:11px 022px;overflow:hidden}ins{color:#777;text-decoration:none}aimg{border:0}@media screen and(max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png)no-repeat;margin-left:-5px}@media only screen and(min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)no-repeat 0% 0%/100%100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)0}}@media only screen and(-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png)no-repeat;-webkit-background-size:100%100%}}#logo{display:inline-block;height:54px;width:150px}

403. That’s an error.

Your client does nothave permission to get URL/identitytoolkit/v3/relyingparty/signupNewUser from thisserver. That’s all we know. ], {}, null))

import 'package:firebase_auth/firebase_auth.dart';

class AuthService {
final FirebaseAuth _auth = FirebaseAuth.instance;

// sign in anon
Future signInAnon() async {
try {
UserCredential userCredential = await _auth.signInAnonymously();
User user = userCredential.user;
return user;
} catch (e) {
print(e.toString());
return null;
}
}

// sign in with email and password

// register with email and password

// sign out

}
Dart
import 'package:auth_flutter_coffe/Services/Auth.dart';
import 'package:flutter/material.dart';

class SignIn extends StatefulWidget {
@override
_SignInState createState() => _SignInState();
}

class _SignInState extends State<SignIn> {
final AuthService _auth = AuthService();

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.brown[700],
appBar: AppBar(
title: Text("SignIn"),
centerTitle: true,
backgroundColor: Colors.brown[900],
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 50.0, vertical: 50.0),
child: RaisedButton.icon(
onPressed: () async {
dynamic result = await _auth.signInAnon();
if (result == null) {
print("You Have to be SignIn");
} else {
print("SignIn");
print(result);
}
},
icon: Icon(Icons.transit_enterexit),
label: Text("SignIn")),
),
);
}
}

最佳答案

检查google-service.json中的项目ID,并且build.gradle文件必须相同。

关于firebase - Firebase不会返回用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64350239/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com