我的代码运行无任何错误,但无法读取其他应用数据库:
public void initialize() {
FirebaseOptions options = new FirebaseOptions.Builder()
.setApplicationId("1...5")//Required for analytics
.setApiKey("Al...yA")//Required for auth
.setDatabaseUrl("https://...firebaseio.com")
.build();
FirebaseApp.initializeApp(this,options,"project ID");
FirebaseApp secondApp = FirebaseApp.getInstance("project ID");
FirebaseDatabase firstDatabase = FirebaseDatabase.getInstance();
FirebaseDatabase secondDatabase = FirebaseDatabase.getInstance(secondApp);
secondDatabase.getReference().setValue(ServerValue.TIMESTAMP);
}
是否可以同时使用2 FirebaseDatabase
?
我该怎么做?