我如何使用Firebase存储将其存储到不同的存储桶中 [英] How can i store to different storage buckets using Firebase Storage

查看:153
本文介绍了我如何使用Firebase存储将其存储到不同的存储桶中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用Firebase存储将数据传递/存储到其他项目/应用程序?如何初始化我的应用程序以调用另一个Firebase存储桶? 一个以上的Firebase数据库我只是尝试使用

$ b配置Firebase存储的初始化
$ b pre $ FirebaseOptions options = new FirebaseOptions.Builder()
.setApiKey(AI ... j0)
.setApplicationId( 1:5 ... e0)
.setDatabaseUrl(https://myapp.firebaseio.com)
.build();
FirebaseApp secondApp = FirebaseApp.initializeApp(getApplicationContext(),options,second app);
// storage
FirebaseStorage存储= FirebaseStorage.getInstance(secondApp);
StorageReference storageRef = storage.getReferenceFromUrl(gs:// .......);


Is there a way to communicate/store data to another project/application using Firebase Storage? How can I initialize my application to call another Firebase Storage Bucket?

解决方案

Referring to this More than one Firebase Database i just tried to configure the initialization of the Firebase Storage by using

   FirebaseOptions options = new FirebaseOptions.Builder()
            .setApiKey("AI...j0")
            .setApplicationId("1:5...e0")
            .setDatabaseUrl("https://myapp.firebaseio.com")
            .build();
    FirebaseApp secondApp = FirebaseApp.initializeApp(getApplicationContext(), options, "second app");
    //storage
    FirebaseStorage storage = FirebaseStorage.getInstance(secondApp);
    StorageReference storageRef = storage.getReferenceFromUrl("gs://.......");

这篇关于我如何使用Firebase存储将其存储到不同的存储桶中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆