Skip to content

🔥 Storage does not support App as parameter #1926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
5 tasks done
ALexandreM75013 opened this issue Feb 26, 2019 · 7 comments
Closed
5 tasks done

🔥 Storage does not support App as parameter #1926

ALexandreM75013 opened this issue Feb 26, 2019 · 7 comments
Labels
plugin: storage Firebase Cloud Storage type: bug New bug report

Comments

@ALexandreM75013
Copy link

Issue

Hi !

I am using several databases and buckets for my mobile application.
I am initializing my App with :

await firebase.initializeApp(
      {
        appId: 'XXXX',
        apiKey: 'XXXX',
        databaseURL: 'XXXX',
        storageBucket: 'XXXX',
        messagingSenderId: 'XXXX',
        projectId: 'XXXX',
      },
    'database1',
  );

and then for using this particular database I am using :

 const database = firebase.app('database1').database();
 await database.ref('/users/')
.set({
  username:  username,
  last_update: firebase.database.ServerValue.TIMESTAMP,
});

which works like a charm, but when I want to use the bucket also initialize with the same database I am using:

const app = firebase.app('database1');
const storage = firebase.app().storage(app);

And I have an error Error: storage does not support a URL or region as a param, please pass in an app., which I don't really understand why since I put a console.log for the constant app, and it is a Firebase App.

I also tried

firebase.app('database1').storage();

but the application crashed and said The storage uri cannot contain a path element.


Project Files

Android

android/app/build.gradle:

implementation project(':react-native-firebase')
implementation "com.google.firebase:firebase-core:16.0.7"
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation "com.google.firebase:firebase-auth:16.1.0"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation "com.google.firebase:firebase-database:16.0.6"
implementation "com.google.firebase:firebase-storage:16.0.5"
implementation "com.google.firebase:firebase-invites:16.1.0"

Environment

  • Platform that you're experiencing the issue on:
    • Android but have not tested behavior on iOS
  • If known, the version of the platform are you experiencing the issue on:
    • Android API 28
  • Operating System:
    • Windows, version: 8.1
  • Build Tools:
    • Android Studio 3.2
  • **React Native version: 0.55.4
  • **React Native Firebase library version: 5.1.1
  • **Firebase module(s) you're using that has the issue:
    • Storage
  • Are you using TypeScript?
    • No
  • Are you using Expo, e.g. ExpoKit?
    • No
@stale
Copy link

stale bot commented Mar 26, 2019

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Mar 26, 2019
@stale
Copy link

stale bot commented Apr 23, 2019

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Apr 23, 2019
@mikehardy
Copy link
Collaborator

@Salakar This is a tangent but they just added multi-app support to remoteconfig - not sure if that is in v6 (you can see it in the android sdk release notes and they link here: https://firebase.google.com/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#getInstance(FirebaseApp) )

For the specific issue the API for storage does seem to support multi-app so it seems like this should work, though @AlexandreMaistret may have learned something in the time after filing the issue and just isn't responding to the stale-bot ?

@ALexandreM75013
Copy link
Author

Unfortunately @mikehardy I didn't find any solution for this. I am just using several databases for one bucket storage.

@mikehardy mikehardy added plugin: storage Firebase Cloud Storage type: bug New bug report and removed Type: Stale Issue has become stale - automatically added by Stale bot labels Apr 23, 2019
@mikehardy
Copy link
Collaborator

I think this is valid then, and more over I believe @Salakar is right.this.moment. working on storage v6 so it might be easy to investigate while he's got all the right tools laid out on the workbench

@mikehardy mikehardy reopened this Apr 23, 2019
@Salakar
Copy link
Contributor

Salakar commented May 1, 2019

The correct usage is as demonstrated in Example 2 & 3 here: https://invertase.io/oss/react-native-firebase/v6/storage/reference/module

Multiple apps work in v5 this way, multi-buckets support however only lands in v6 - have just finished the storage re-write about an hour ago (just working through android CI being a PITA)

image

@Salakar
Copy link
Contributor

Salakar commented May 3, 2019

Closing as v6 Cloud Storage PR has landed. Will publish an alpha release later today.

Thanks again 👍

@Salakar Salakar closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: storage Firebase Cloud Storage type: bug New bug report
Projects
None yet
Development

No branches or pull requests

3 participants