gpt4 book ai didi

java - Firebase 身份验证服务器错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:38:44 24 4
gpt4 key购买 nike

我收到以下错误:

For a custom firebase host you must first set your authentication 
server before using authentication features!

我的代码:

public void initialize() throws IOException {

FileInputStream serviceAccount = new FileInputStream("/Users/ryan/dev/uandmemelogin/src/main/java/rgross/kmccann/firebase.json");

FirebaseOptions options = new FirebaseOptions.Builder()
.setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
.setDatabaseUrl("https://uandmeme-57321.firebaseio.com/")

.build();

FirebaseApp.initializeApp(options);

firebase.createUser("rgross", "ser", new Firebase.ValueResultHandler<Map<String, Object>>() {
@Override
public void onSuccess(Map<String, Object> stringObjectMap) {
System.out.println("Worked");
}

@Override
public void onError(FirebaseError firebaseError) {
System.out.println("Failed");
}
});

我做错了什么?我已按照文档进行操作,但仍然很困难。

最佳答案

很可能您在初始化 Firebase 连接时使用了错误的网址。

确保它采用以下格式:

objective-c

Firebase *myRootRef = [[Firebase alloc] initWithUrl:@"https://<YOUR-FIREBASE-APP>.firebaseio.com"];

关于java - Firebase 身份验证服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43008083/

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