简体   繁体   English

有没有办法更改默认的 Firebase 存储桶?

[英]Is there a way to change the default Firebase Storage Bucket?

I know there are already similar posts about this topic but they do not cover it completely.我知道已经有关于这个主题的类似帖子,但它们并没有完全涵盖它。

This one is the exact question I have but the answer is not about changing the default bucket but changing your app's config to use that bucket. 这是我的确切问题,但答案不是关于更改默认存储桶,而是更改应用程序的配置以使用该存储桶。

This one also has the same question but the answer is just about how to delete the bucket. 这个也有同样的问题,但答案只是关于如何删除桶。

What I want is a way to change the default bucket so that any app I use from my firebase project will use this default bucket.我想要的是一种更改默认存储桶的方法,以便我在 firebase 项目中使用的任何应用程序都将使用此默认存储桶。

But if that wasn't possible, this is what I have tried so far:但如果那不可能,这就是我到目前为止所尝试的:

  1. I have also tried to change the configuration file called google-services.json which inside you can change the storage_bucket key's value BUT my app still uses the default bucket when uploading files.我还尝试更改名为 google-services.json 的配置文件,您可以在其中更改 storage_bucket 键的值,但我的应用程序在上传文件时仍使用默认存储桶。 (this is the method firebase support told me to do but it's not working and they said they did not provide flutter support) (这是 firebase 支持告诉我的方法,但它不起作用,他们说他们没有提供 flutter 支持)
  2. Then there is another method I googled which I think involves changing the whole app config by using Firebase.initializeApp() method but this one requires me to change the whole project id, bucket, and a bunch of other keys.然后我用谷歌搜索了另一种方法,我认为它涉及使用 Firebase.initializeApp() 方法更改整个应用程序配置,但是这个方法需要我更改整个项目 ID、存储桶和一堆其他键。
  3. If there is no way to fix this, I am thinking of deleting the default bucket, then hopefully the new bucket will take over that default spot.如果没有办法解决这个问题,我正在考虑删除默认存储桶,然后希望新存储桶能够接管该默认位置。

Make sure that when you make changes to the google services file, you do flutter clean and pub get packages.确保在更改 google 服务文件时执行 flutter clean 和 pub get packages。 Then it will take effect,然后就会生效,

I had an issue with the firebase storage bucket and I wanted to change to a storage bucket from another firebase account.我的 firebase 存储桶有问题,我想更改为另一个 firebase 帐户的存储桶。 I did and make v=chages to the google services file but until I did flutter clean I was not able to see changes.我做了 v=chages 到谷歌服务文件,但直到我做了 flutter clean 我才能够看到变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python:上传Pillow Image到Firebase存储桶 - Python: upload Pillow Image to Firebase storage bucket 在 GCP Console 中创建存储桶后无法访问 Firebase 存储 - Cannot access Firebase Storage after creating storage bucket in GCP Console 如何让firebase function模拟器使用生产firebase存储桶 - How to let firebase function emulator use production firebase storage bucket 如何在 Firebase 函数中获取默认存储桶名称? - How to get the default bucket name in Firebase Functions? 获取 Google Storage 存储桶大小的最快方法? - Fastest way to get Google Storage bucket size? firebase 存储文件名更改 - firebase storage file name change 是否可以将 Firebase 函数的范围限定在存储桶内的文件夹中? - Is it possible to scope Firebase functions to a folder inside a storage bucket? 除了删除和上传之外,更新 firebase 存储桶中的图像有什么替代方法? - What is an alternative to updating an image in firebase storage bucket than deleting and uploaded? 如何停止列出 Firebase 存储公共存储桶中的所有项目? - How to stop listing all items in a Firebase Storage public bucket? 如何使用生产存储桶数据启动 Firebase 存储模拟器? - How do I start the Firebase Storage Emulator with production bucket data?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM