mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
Move file methods / constants from storage to utils (#2511)
* stash * move commons into the app * move utils module into app * Update index.d.ts * re-trigger build * fix eslint issues * Fix formatting eslint issues * move utils documentation to app * Dissalow number values in setUserProperties * fix test * add utils export to app module * clean up utils export * Move path helpers to utilities module * I have no idea * Update RNFBUtilsModule.m * remove duplicate util files * fix RNFBUtilsModule merge conflict * fix android build * Move path constants from storage to utils, remove old GH Actions * resolve remaining merge confs * resolve type definition conflict * add requiresMainQueueSetup to RNFBUtilsModule
This commit is contained in:
@@ -13,14 +13,14 @@ App initialization in React Native Firebase is, for the most part, the same as t
|
||||
|
||||
Only some modules on the official Firebase native SDK's support multiple apps, they are as follows:
|
||||
|
||||
- Authentication
|
||||
- Database
|
||||
- Firestore
|
||||
- Functions
|
||||
- Instance ID
|
||||
- Storage
|
||||
- ML Kit Natural Language
|
||||
- ML Kit Vision
|
||||
- Authentication
|
||||
- Database
|
||||
- Firestore
|
||||
- Functions
|
||||
- Instance ID
|
||||
- Storage
|
||||
- ML Kit Natural Language
|
||||
- ML Kit Vision
|
||||
|
||||
For further information, view [Firebase Documentation for Multiple Projects](https://firebase.google.com/docs/web/setup#multiple-projects).
|
||||
|
||||
@@ -60,12 +60,14 @@ const androidConfig = {
|
||||
persistence: true,
|
||||
};
|
||||
|
||||
const kittensApp = firebase.initializeApp(
|
||||
// use platform-specific firebase config
|
||||
Platform.OS === 'ios' ? iosConfig : androidConfig,
|
||||
// name of this app
|
||||
'kittens',
|
||||
).then(app => console.log('initialized apps ->', firebase.apps));
|
||||
const kittensApp = firebase
|
||||
.initializeApp(
|
||||
// use platform-specific firebase config
|
||||
Platform.OS === 'ios' ? iosConfig : androidConfig,
|
||||
// name of this app
|
||||
'kittens',
|
||||
)
|
||||
.then(app => console.log('initialized apps ->', firebase.apps));
|
||||
```
|
||||
|
||||
## Initialize apps via Android/iOS native code
|
||||
@@ -78,12 +80,11 @@ For example, if you created an app natively called `dogs` then the following wou
|
||||
import firebase from '@react-native-firebase/app';
|
||||
|
||||
const dogsApp = firebase.app('dogs');
|
||||
|
||||
```
|
||||
|
||||
## Deleting an app instance
|
||||
|
||||
Firebase App instances can be deleted via `app.delete()`.
|
||||
Firebase App instances can be deleted via `app.delete()`.
|
||||
|
||||
```js
|
||||
await firebase.app('kittens').delete();
|
||||
|
||||
@@ -51,4 +51,3 @@ The instance is also accessible from other installed packages, for example:
|
||||
```js
|
||||
import auth, { firebase } from '@react-native-firebase/auth';
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user