Optionalpath: stringAn optional string pointing to a location on the storage bucket. If no path is provided, the returned reference will be the bucket root path.
Returns a new Reference instance from a storage bucket URL.
const gsUrl = 'gs://react-native-firebase-testing/cats.gif';
const httpUrl = 'https://firebasestorage.googleapis.com/v0/b/react-native-firebase-testing.appspot.com/o/cats.gif';
const refFromGsUrl = firebase.storage().refFromURL(gsUrl);
// or
const refFromHttpUrl = firebase.storage().refFromURL(httpUrl);
A storage bucket URL pointing to a single file or location. Must be either a gs:// url or an http url,
e.g. gs://assets/logo.png or https://firebasestorage.googleapis.com/v0/b/react-native-firebase-testing.appspot.com/o/cats.gif.
Modify this Storage instance to communicate with the Firebase Storage emulator. This must be called synchronously immediately following the first call to firebase.storage(). Do not use with production credentials as emulator traffic is not encrypted.
Note: on android, hosts 'localhost' and '127.0.0.1' are automatically remapped to '10.0.2.2' (the "host" computer IP address for android emulators) to make the standard development experience easy. If you want to use the emulator on a real android device, you will need to specify the actual host computer IP address.
emulator host (eg, 'localhost')
emulator port (eg, 9199)
The Cloud Storage service is available for the default app, a given app or a specific storage bucket.
Example 1
Deprecated
Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.
Get the storage instance for the default app:
Example 2
Get the storage instance for a secondary app:
Example 3
Get the storage instance for a specific storage bucket: