我正在尝试删除 secondaryApp 代码,因为我想阻止该功能 firebaseAuth.createUserWithEmailAndPassword(email,password)在用户创建后自动登录
我参考了下面的代码:
FirebaseOptions.Builder fbo = new FirebaseOptions.Builder();
fbo.setApiKey("YOUR_WEB_API_KEY");
fbo.setDatabaseUrl("https://[YOUR_PROJECT_ID].firebaseio.com/");
fbo.setProjectId("YOUR_PROJECT_ID");
fbo.setApplicationId("YOUR_APP_ID"); //Tested, App Id is required.
FirebaseOptions firebaseOptions = fbo.build();
final FirebaseApp secondaryAuth = FirebaseApp.initializeApp([JAVA_CLASS_NAME].this, firebaseOptions, "secondary_db_auth");
它有效,但是当我试图调用该方法时
secondaryAuth.delete()
它返回一个错误,指出无法调用该方法,如下图所示。
我已经检查了来自 firebase [FirebaseApp.delete()][2] 的文档,并希望它能正常工作,但事实并非如此。其他一切都解决了它只是delete()
不工作
https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/FirebaseApp
整个代码实现如下:
private void CreateAccount() {
String name = username.getText().toString();
String phone = phoneNumber.getText().toString();
String email = emailAddress.getText().toString();
String password = passwordTxt.getText().toString();
String confirmPassword = confirmPasswordTxt.getText().toString();
String points = pointsTransfer.getText().toString();
final DatabaseReference RootRef;
final FirebaseAuth firebaseAuth;
FirebaseOptions.Builder fbo = new FirebaseOptions.Builder();
fbo.setApiKey("YOUR_WEB_API_KEY");
fbo.setDatabaseUrl("https://[YOUR_PROJECT_ID].firebaseio.com/");
fbo.setProjectId("YOUR_PROJECT_ID");
fbo.setApplicationId("YOUR_APP_ID"); //Tested, App Id is required.
FirebaseOptions firebaseOptions = fbo.build();
final FirebaseApp secondaryAuth = FirebaseApp.initializeApp([JAVA_CLASS_NAME].this, firebaseOptions, "secondary_db_auth");
RootRef = FirebaseDatabase.getInstance().getReference().child("Users");
firebaseAuth = FirebaseAuth.getInstance(secondaryAuth);
}
HUH函数
相关分类