EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

storage functions on NS7 error "Cannot read property 'listAll' of undefined" #1787

Open vetter99 opened 3 years ago

vetter99 commented 3 years ago

Whenever any firebase storage function is called I receive: CONSOLE ERROR: ERROR TypeError: Cannot read property 'listAll' of undefined This same app is able to use firestore to retrieve collections and documents, but storage functions do not seem to be recognized.

import { firestore, storage } from "@nativescript/firebase";

 storage.listAll({
        bucket: "gs://appname-xxxx.appspot.com",
        remoteFullPath: ""
      }).then(
          function (result) {
              console.log(JSON.stringify(result));
          },
          function (error) {
              console.log(error);
          }
      );

firebase.nativescript.json

{
    "using_ios": true,
    "using_android": false,
    "analytics": true,
    "firestore": true,
    "realtimedb": false,
    "authentication": true,
    "remote_config": false,
    "performance_monitoring": false,
    "external_push_client_only": false,
    "messaging": false,
    "in_app_messaging": false,
    "crashlytics": true,
    "storage": true,
    "functions": false,
    "facebook_auth": true,
    "google_auth": true,
    "admob": false,
    "dynamic_links": false,
    "ml_kit": false
}
davecoffin commented 3 years ago

I am also getting this, @JJVetter you ever figure out whats going on?

davecoffin commented 3 years ago

Figured this out, just confusing documentation, if youre on @nativescript/firebase you need to import like this import { storage } from '@nativescript/firebase/storage'

I also discovered the build process isn't un-commenting the pods in the plugins podfile for storage, so I had to manually uncomment the pod in the plugins podfile. I'll probably just add to my AppResources podfile to make sure it always makes it in.