mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-23 20:10:05 +08:00
[internal] Move @react-native-firebase/utils into /app (#2487)
This commit is contained in:
committed by
Mike Diarmid
parent
ee04d34fc3
commit
c7f58f8afc
@@ -27,7 +27,6 @@ The following modules are completed and published to NPM and ready to be consume
|
||||
| [Performance Monitoring](/packages/perf) | [](https://www.npmjs.com/package/@react-native-firebase/perf) | [](https://api.rnfirebase.io/coverage/perf/detail) |
|
||||
| [Realtime Database](/packages/database) | [](https://www.npmjs.com/package/@react-native-firebase/database) | [](https://api.rnfirebase.io/coverage/database/detail) |
|
||||
| [Remote Config](/packages/remote-config) | [](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [](https://api.rnfirebase.io/coverage/remote-config/detail) |
|
||||
| [Utils](/packages/utils) | [](https://www.npmjs.com/package/@react-native-firebase/utils) | [](https://api.rnfirebase.io/coverage/utils/detail) |
|
||||
|
||||
---
|
||||
|
||||
@@ -144,7 +143,7 @@ AdMob has undergone a full rewrite to keep up-to-date with the latest changes an
|
||||
- [NEW] Added support for custom network extras on ad requests via `networkExtras`.
|
||||
- The user reward is now pre-fetched when the ad is loaded.
|
||||
- [BREAKING] The API interface for interacting with AdMob has undergone a full re-write.
|
||||
- [BUGFIX] Ads can now work during React Native debugging.
|
||||
- [BUGFIX] Ads can now work during React Native debugging.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -63,15 +63,6 @@ The main package that you interface with is `App` (`@react-native-firebase/app`)
|
||||
| [Performance Monitoring](/packages/perf) | [](https://www.npmjs.com/package/@react-native-firebase/perf) | [](https://api.rnfirebase.io/coverage/perf/detail) |
|
||||
| [Realtime Database](/packages/database) | [](https://www.npmjs.com/package/@react-native-firebase/database) | [](https://api.rnfirebase.io/coverage/database/detail) |
|
||||
| [Remote Config](/packages/remote-config) | [](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [](https://api.rnfirebase.io/coverage/remote-config/detail) |
|
||||
| [Utils](/packages/utils) | [](https://www.npmjs.com/package/@react-native-firebase/utils) | [](https://api.rnfirebase.io/coverage/utils/detail) |
|
||||
|
||||
## Other Packages
|
||||
|
||||
React Native Firebase also publishes other packages.
|
||||
|
||||
| Name | Description |
|
||||
| -------------------------- | :-----------------------------------: |
|
||||
| [common](/packages/common) | Common utilities used by all modules. |
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ Only some modules on the official Firebase native SDK's support multiple apps, t
|
||||
|
||||
For further information, view [Firebase Documentation for Multiple Projects](https://firebase.google.com/docs/web/setup#multiple-projects).
|
||||
|
||||
# Initialize apps via JavaScript
|
||||
## Initialize apps via JavaScript
|
||||
|
||||
## Cross Platform Example
|
||||
### Cross Platform Example
|
||||
|
||||
```javascript
|
||||
import { Platform } from 'react-native';
|
||||
@@ -68,7 +68,7 @@ const kittensApp = firebase.initializeApp(
|
||||
).then(app => console.log('initialized apps ->', firebase.apps));
|
||||
```
|
||||
|
||||
# Initialize apps via Android/iOS native code
|
||||
## Initialize apps via Android/iOS native code
|
||||
|
||||
If you're familiar with native code you can create apps natively also (or if you are already initializing additional apps natively on app boot) - these apps automatically become available for use inside RNFirebase.
|
||||
|
||||
@@ -81,7 +81,7 @@ const dogsApp = firebase.app('dogs');
|
||||
|
||||
```
|
||||
|
||||
# Deleting an app instance
|
||||
## Deleting an app instance
|
||||
|
||||
Firebase App instances can be deleted via `app.delete()`.
|
||||
|
||||
|
||||
@@ -50,4 +50,5 @@ The instance is also accessible from other installed packages, for example:
|
||||
|
||||
```js
|
||||
import auth, { firebase } from '@react-native-firebase/auth';
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
@@ -43,5 +43,4 @@ for installation instructions on each individual module page.
|
||||
| <Anchor href="/notifications">Notifications</Anchor> | <Badge type="downloads">@react-native-firebase/notifications</Badge> | <Badge type="coverage">notifications</Badge> |
|
||||
| <Anchor href="/perf">Performance Monitoring</Anchor> | <Badge type="downloads">@react-native-firebase/perf</Badge> | <Badge type="coverage">perf</Badge> |
|
||||
| <Anchor href="/database">Realtime Database</Anchor> | <Badge type="downloads">@react-native-firebase/database</Badge> | <Badge type="coverage">database</Badge> |
|
||||
| <Anchor href="/remote-config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/remote-config</Badge> | <Badge type="coverage">remote-config</Badge> |
|
||||
| <Anchor href="/utils">Utils</Anchor> | <Badge type="downloads">@react-native-firebase/utils</Badge> | <Badge type="coverage">utils</Badge> |
|
||||
| <Anchor href="/remote-config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/remote-config</Badge> | <Badge type="coverage">remote-config</Badge> |
|
||||
|
||||
11757
docs/typedoc.json
vendored
11757
docs/typedoc.json
vendored
File diff suppressed because it is too large
Load Diff
2
docs/typedoc.min.json
vendored
2
docs/typedoc.min.json
vendored
File diff suppressed because one or more lines are too long
@@ -1,30 +1,31 @@
|
||||
---
|
||||
title: Utils
|
||||
description: The Utils package provides public access to internal methods to aide with development
|
||||
description: The Utils package exports several utilities that assist with using React Native Firebase in your app.
|
||||
---
|
||||
|
||||
# Utils
|
||||
|
||||
The Utils package provides a public JavaScript interface to internal functionality that has been created as part of the
|
||||
development of the React Native Firebase library.
|
||||
The Utils package exports several utilities that assist with using React Native Firebase in your app.
|
||||
|
||||
## Getting Started
|
||||
|
||||
> This module automatically comes with the `@react-native-firebase/app` package, there are no additional steps required to install it.
|
||||
|
||||
<Grid columns="2">
|
||||
<Block
|
||||
icon="build"
|
||||
color="#ffc107"
|
||||
title="Quick Start"
|
||||
to="/quick-start"
|
||||
>
|
||||
Start using the utilities in your own application.
|
||||
</Block>
|
||||
<Block
|
||||
icon="layers"
|
||||
color="#03A9F4"
|
||||
title="Reference"
|
||||
to="/reference"
|
||||
>
|
||||
The API reference covers everything required to use the utils within your own application.
|
||||
</Block>
|
||||
icon="build"
|
||||
color="#ffc107"
|
||||
title="Quick Start"
|
||||
to="/quick-start"
|
||||
>
|
||||
Quick guide to using the utilities in your own application.
|
||||
</Block>
|
||||
<Block
|
||||
icon="layers"
|
||||
color="#03A9F4"
|
||||
title="Reference"
|
||||
to="/reference"
|
||||
>
|
||||
The API reference documentation for the Utils module.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
@@ -5,7 +5,7 @@ description: Getting started with the Utils package in React Native Firebase
|
||||
|
||||
# Utils Quick Start
|
||||
|
||||
The utils module comes installed with the `app` module.
|
||||
> This module automatically comes with the `@react-native-firebase/app` package, there are no additional steps required to install it.
|
||||
|
||||
## Module usage
|
||||
|
||||
@@ -13,9 +13,18 @@ Import the Utils package into your project:
|
||||
|
||||
```js
|
||||
import { utils } from '@react-native-firebase/app';
|
||||
|
||||
// utils().X
|
||||
|
||||
import firebase from '@react-native-firebase/app';
|
||||
|
||||
// firebase.utils().X
|
||||
|
||||
```
|
||||
|
||||
### Detect whether the app is running within TestL Lab
|
||||
## Utilities
|
||||
|
||||
### Detect whether your app is running within Firebase Test Lab
|
||||
|
||||
Firebase [TestLab](https://firebase.google.com/docs/test-lab/?utm_source=invertase&utm_medium=react-native-firebase&utm_campaign=utils)
|
||||
is a cloud-based app-testing infrastructure. With one operation, you can test your Android or iOS app across
|
||||
@@ -38,12 +47,11 @@ async function bootstrap() {
|
||||
|
||||
### Access device file paths
|
||||
|
||||
Some modules require access to your local device filesystem (such as Storage & ML Kit Vision). The utils
|
||||
module access to the device directory locations, working cross platform on Android & iOS.
|
||||
Some modules require access to your local device filesystem (such as Storage & ML Kit Vision). The utils module provides paths to common device directory locations.
|
||||
|
||||
```js
|
||||
import { utils } from '@react-native-firebase/app';
|
||||
|
||||
import firebase from '@react-native-firebase/app';
|
||||
// Access the device pictures directory
|
||||
const picturesDir = utils.FilePath.PICTURES_DIRECTORY;
|
||||
const picturesDir = firebase.utils.FilePath.PICTURES_DIRECTORY;
|
||||
```
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('analytics()', () => {
|
||||
return Promise.reject(new Error('Did not throw.'));
|
||||
} catch (e) {
|
||||
e.message.should.containEql(
|
||||
`'name' the event name 'session_start' is reserved and can not be used`,
|
||||
"'name' the event name 'session_start' is reserved and can not be used",
|
||||
);
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -309,7 +309,7 @@ describe('analytics()', () => {
|
||||
it('throws if property value is invalid', async () => {
|
||||
try {
|
||||
await firebase.analytics().setUserProperties({
|
||||
test: 123,
|
||||
test: '123',
|
||||
foo: {
|
||||
bar: 'baz',
|
||||
},
|
||||
@@ -320,16 +320,23 @@ describe('analytics()', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('throws if value is a number', async () => {
|
||||
try {
|
||||
await firebase.analytics().setUserProperties({ invertase1: 123 });
|
||||
return Promise.reject(new Error('Did not throw.'));
|
||||
} catch (e) {
|
||||
e.message.should.containEql(
|
||||
"'properties' value for parameter 'invertase1' is invalid, expected a string.",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('allows null values to be set', async () => {
|
||||
await firebase.analytics().setUserProperties({ invertase: null });
|
||||
await firebase.analytics().setUserProperties({ invertase2: null });
|
||||
});
|
||||
|
||||
it('accepts string values', async () => {
|
||||
await firebase.analytics().setUserProperties({ invertase2: 'rn-firebase' });
|
||||
});
|
||||
|
||||
it('accepts number values', async () => {
|
||||
await firebase.analytics().setUserProperties({ invertase3: 123 });
|
||||
await firebase.analytics().setUserProperties({ invertase3: 'rn-firebase' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
import {
|
||||
isAlphaNumericUnderscore,
|
||||
isNull,
|
||||
isNumber,
|
||||
isObject,
|
||||
isOneOf,
|
||||
isString,
|
||||
isNumber,
|
||||
isUndefined,
|
||||
} from '@react-native-firebase/app/lib/common';
|
||||
import {
|
||||
@@ -29,8 +29,8 @@ import {
|
||||
FirebaseModule,
|
||||
getFirebaseRoot,
|
||||
} from '@react-native-firebase/app/lib/internal';
|
||||
import version from './version';
|
||||
import { isBoolean } from '../../app/lib/common';
|
||||
import version from './version';
|
||||
|
||||
const ReservedEventNames = [
|
||||
'app_clear_data',
|
||||
@@ -188,9 +188,9 @@ class FirebaseAnalyticsModule extends FirebaseModule {
|
||||
const entries = Object.entries(properties);
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
const [key, value] = entries[i];
|
||||
if (!isNull(value) && (!isString(value) && !isNumber(value))) {
|
||||
if (!isNull(value) && !isString(value)) {
|
||||
throw new Error(
|
||||
`firebase.analytics().setUserProperties(*) 'properties' value for parameter '${key}' is invalid, expected a string or number value.`,
|
||||
`firebase.analytics().setUserProperties(*) 'properties' value for parameter '${key}' is invalid, expected a string.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@ import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
import io.invertase.firebase.utils.ReactNativeFirebaseUtilsModule;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ReactNativeFirebaseAppPackage implements ReactPackage {
|
||||
@@ -37,9 +38,11 @@ public class ReactNativeFirebaseAppPackage implements ReactPackage {
|
||||
}
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new ReactNativeFirebaseAppModule(reactContext));
|
||||
modules.add(new ReactNativeFirebaseUtilsModule(reactContext));
|
||||
return modules;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -21,27 +21,21 @@ import android.app.Activity;
|
||||
import android.content.IntentSender;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Promise;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.*;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import io.invertase.firebase.app.ReactNativeFirebaseApp;
|
||||
import io.invertase.firebase.common.ReactNativeFirebaseModule;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.invertase.firebase.app.ReactNativeFirebaseApp;
|
||||
import io.invertase.firebase.common.ReactNativeFirebaseModule;
|
||||
|
||||
public class ReactNativeFirebaseUtilsModule extends ReactNativeFirebaseModule {
|
||||
private static final String TAG = "Utils";
|
||||
|
||||
private static final String FIREBASE_TEST_LAB = "firebase.test.lab";
|
||||
|
||||
ReactNativeFirebaseUtilsModule(ReactApplicationContext reactContext) {
|
||||
public ReactNativeFirebaseUtilsModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext, TAG);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
2748D8172236429D00FC8DC8 /* RNFBSharedUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D8102236417700FC8DC8 /* RNFBSharedUtils.m */; };
|
||||
2748D81C223674CD00FC8DC8 /* RNFBPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D81B223674CD00FC8DC8 /* RNFBPreferences.m */; };
|
||||
2748D8202237018600FC8DC8 /* RNFBMeta.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D81F2237018600FC8DC8 /* RNFBMeta.m */; };
|
||||
4D97BAD423042F2700077358 /* RNFBUtilsModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D97BAD323042F2700077358 /* RNFBUtilsModule.m */; };
|
||||
DAA1F28522FCF6AD00F4DEC1 /* RNFBVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -48,6 +49,8 @@
|
||||
2748D81B223674CD00FC8DC8 /* RNFBPreferences.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBPreferences.m; sourceTree = "<group>"; };
|
||||
2748D81E2237012B00FC8DC8 /* RNFBMeta.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBMeta.h; sourceTree = "<group>"; };
|
||||
2748D81F2237018600FC8DC8 /* RNFBMeta.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBMeta.m; sourceTree = "<group>"; };
|
||||
4D97BAD223042F0800077358 /* RNFBUtilsModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBUtilsModule.h; sourceTree = "<group>"; };
|
||||
4D97BAD323042F2700077358 /* RNFBUtilsModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBUtilsModule.m; sourceTree = "<group>"; };
|
||||
DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBVersion.m; sourceTree = "<group>"; };
|
||||
DAA1F28622FCF6C200F4DEC1 /* RNFBVersion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBVersion.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -92,6 +95,8 @@
|
||||
2748D81B223674CD00FC8DC8 /* RNFBPreferences.m */,
|
||||
DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */,
|
||||
DAA1F28622FCF6C200F4DEC1 /* RNFBVersion.h */,
|
||||
4D97BAD223042F0800077358 /* RNFBUtilsModule.h */,
|
||||
4D97BAD323042F2700077358 /* RNFBUtilsModule.m */,
|
||||
);
|
||||
path = RNFBApp;
|
||||
sourceTree = "<group>";
|
||||
@@ -168,6 +173,7 @@
|
||||
2748D8172236429D00FC8DC8 /* RNFBSharedUtils.m in Sources */,
|
||||
2748D81C223674CD00FC8DC8 /* RNFBPreferences.m in Sources */,
|
||||
DAA1F28522FCF6AD00F4DEC1 /* RNFBVersion.m in Sources */,
|
||||
4D97BAD423042F2700077358 /* RNFBUtilsModule.m in Sources */,
|
||||
2748D8202237018600FC8DC8 /* RNFBMeta.m in Sources */,
|
||||
2744B99121F46140004F8E3F /* RNFBRCTEventEmitter.m in Sources */,
|
||||
2744B9A421F48A4F004F8E3F /* RCTConvert+FIROptions.m in Sources */,
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
#pragma mark -
|
||||
#pragma mark Module Setup
|
||||
|
||||
RCT_EXPORT_MODULE();
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
- (dispatch_queue_t)methodQueue {
|
||||
- (dispatch_queue_t)methodQueue {
|
||||
return dispatch_get_main_queue();
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Firebase Utils Methods
|
||||
177
packages/app/lib/index.d.ts
vendored
177
packages/app/lib/index.d.ts
vendored
@@ -235,7 +235,184 @@ export namespace ReactNativeFirebase {
|
||||
export interface FirebaseJsonConfig {}
|
||||
}
|
||||
|
||||
/*
|
||||
* @firebase utils
|
||||
*/
|
||||
export namespace Utils {
|
||||
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
|
||||
|
||||
/**
|
||||
* A collection of native device file paths to aid in the usage of file path based methods.
|
||||
*
|
||||
* Concatenate a file path with your target file name when using with Storage `putFile` or `writeToFile`.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath;
|
||||
* ```
|
||||
*/
|
||||
export interface FilePath {
|
||||
/**
|
||||
* Returns an absolute path to the applications main bundle.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MAIN_BUNDLE;
|
||||
* ```
|
||||
*
|
||||
* @ios iOS only
|
||||
*/
|
||||
MAIN_BUNDLE: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the application specific cache directory on the filesystem.
|
||||
*
|
||||
* The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.CACHES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
CACHES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the users Documents directory.
|
||||
*
|
||||
* Use this directory to place documents that have been created by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.DOCUMENT_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
DOCUMENT_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a temporary directory.
|
||||
*
|
||||
* Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.TEMP_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
TEMP_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the apps library/resources directory.
|
||||
*
|
||||
* E.g. this can be used for things like documentation, support files, and configuration files and generic resources.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.LIBRARY_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
LIBRARY_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the directory on the primary shared/external storage device.
|
||||
*
|
||||
* Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the primary shared/external storage directory.
|
||||
*
|
||||
* Traditionally this is an SD card, but it may also be implemented as built-in storage on a device.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_STORAGE_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place pictures that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.PICTURES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
PICTURES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place movies that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MOVIES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
MOVIES_DIRECTORY: string;
|
||||
}
|
||||
|
||||
export interface Statics {
|
||||
FilePath: FilePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* The React Native Firebase Utils service interface.
|
||||
*
|
||||
* > This module is available for the default app only.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* Get the Utils service for the default app:
|
||||
*
|
||||
* ```js
|
||||
* const defaultAppUtils = firebase.utils();
|
||||
* ```
|
||||
*/
|
||||
export class Module extends FirebaseModule {
|
||||
/**
|
||||
* Returns true if this app is running inside a Firebase Test Lab environment. Always returns false on iOS.
|
||||
*
|
||||
* @android
|
||||
*/
|
||||
isRunningInTestLab: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/app' {
|
||||
/**
|
||||
* Add Utils module as a named export for `app`.
|
||||
*/
|
||||
export const utils: ReactNativeFirebase.FirebaseModuleWithStatics<Utils.Module, Utils.Statics>;
|
||||
|
||||
/**
|
||||
* Default Firebase export.
|
||||
*/
|
||||
const module: {} & ReactNativeFirebase.Module;
|
||||
export default module;
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/app' {
|
||||
/**
|
||||
* Attach Utils namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
namespace ReactNativeFirebase {
|
||||
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
|
||||
|
||||
interface Module {
|
||||
/**
|
||||
* Utils provides a collection of utilities to aid in using Firebase
|
||||
* and related services inside React Native, e.g. Test Lab helpers
|
||||
* and Google Play Services version helpers.
|
||||
*/
|
||||
utils: FirebaseModuleWithStatics<Utils.Module, Utils.Statics>;
|
||||
}
|
||||
|
||||
interface FirebaseApp {
|
||||
utils(): Utils.Module;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,6 @@
|
||||
import { getFirebaseRoot } from './internal/registry/namespace';
|
||||
|
||||
export const firebase = getFirebaseRoot();
|
||||
export utils from './utils';
|
||||
|
||||
export default firebase;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import { stripTrailingSlash } from '@react-native-firebase/app/lib/common';
|
||||
import { NativeModules } from 'react-native';
|
||||
import { stripTrailingSlash } from '../../lib/common';
|
||||
|
||||
// TODO(salakar) refactor once deprecations have been removed
|
||||
const PATH_NAMES = {
|
||||
@@ -77,6 +77,7 @@ function processPathConstants(nativeModule) {
|
||||
}
|
||||
|
||||
export default {
|
||||
SDK_VERSION: require('./../version'),
|
||||
get FilePath() {
|
||||
// TODO move from storage native code into utils native code
|
||||
return processPathConstants(NativeModules.RNFBStorageModule);
|
||||
@@ -15,18 +15,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import { isIOS } from '@react-native-firebase/app/lib/common';
|
||||
import {
|
||||
createModuleNamespace,
|
||||
FirebaseModule,
|
||||
getFirebaseRoot,
|
||||
} from '@react-native-firebase/app/lib/internal';
|
||||
import { isIOS } from '../../lib/common';
|
||||
import UtilsStatics from './UtilsStatics';
|
||||
import version from './version';
|
||||
import { createModuleNamespace, FirebaseModule } from '../../lib/internal';
|
||||
|
||||
const namespace = 'utils';
|
||||
const statics = UtilsStatics;
|
||||
|
||||
const nativeModuleName = 'RNFBUtilsModule';
|
||||
|
||||
class FirebaseUtilsModule extends FirebaseModule {
|
||||
@@ -38,14 +32,11 @@ class FirebaseUtilsModule extends FirebaseModule {
|
||||
}
|
||||
}
|
||||
|
||||
// import { SDK_VERSION } from '@react-native-firebase/utils';
|
||||
export const SDK_VERSION = version;
|
||||
|
||||
// import utils from '@react-native-firebase/utils';
|
||||
// import { utils } from '@react-native-firebase/app';
|
||||
// utils().X(...);
|
||||
export default createModuleNamespace({
|
||||
statics,
|
||||
version,
|
||||
version: UtilsStatics.SDK_VERSION,
|
||||
namespace,
|
||||
nativeModuleName,
|
||||
nativeEvents: false,
|
||||
@@ -53,8 +44,3 @@ export default createModuleNamespace({
|
||||
hasCustomUrlOrRegionSupport: false,
|
||||
ModuleClass: FirebaseUtilsModule,
|
||||
});
|
||||
|
||||
// import utils, { firebase } from '@react-native-firebase/utils';
|
||||
// utils().X(...);
|
||||
// firebase.utils().X(...);
|
||||
export const firebase = getFirebaseRoot();
|
||||
42
packages/app/type-test.ts
Normal file
42
packages/app/type-test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import firebase, { utils } from '@react-native-firebase/app';
|
||||
|
||||
// checks module exists at root
|
||||
console.log(firebase.utils().app.name);
|
||||
console.log(utils().app.name);
|
||||
|
||||
// checks module exists at app level
|
||||
console.log(firebase.app().utils().app.name);
|
||||
|
||||
// checks statics exist
|
||||
console.log(firebase.utils.SDK_VERSION);
|
||||
console.log(utils.SDK_VERSION);
|
||||
console.log(firebase.utils.FilePath.CACHES_DIRECTORY);
|
||||
console.log(utils.FilePath.CACHES_DIRECTORY);
|
||||
|
||||
console.log(firebase.utils.FilePath.CACHES_DIRECTORY);
|
||||
console.log(utils.FilePath.CACHES_DIRECTORY);
|
||||
|
||||
// checks root exists
|
||||
console.log(firebase.SDK_VERSION);
|
||||
|
||||
// checks multi-app support exists
|
||||
// console.log(firebase.utils(firebase.app()).app.name);
|
||||
|
||||
// checks default export supports app arg
|
||||
// console.log(defaultExport(firebase.app()).app.name);
|
||||
@@ -1,66 +0,0 @@
|
||||
# Built application files
|
||||
android/*/build/
|
||||
|
||||
# Crashlytics configuations
|
||||
android/com_crashlytics_export_strings.xml
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
android/local.properties
|
||||
|
||||
# Gradle generated files
|
||||
android/.gradle/
|
||||
|
||||
# Signing files
|
||||
android/.signing/
|
||||
|
||||
# User-specific configurations
|
||||
android/.idea/gradle.xml
|
||||
android/.idea/libraries/
|
||||
android/.idea/workspace.xml
|
||||
android/.idea/tasks.xml
|
||||
android/.idea/.name
|
||||
android/.idea/compiler.xml
|
||||
android/.idea/copyright/profiles_settings.xml
|
||||
android/.idea/encodings.xml
|
||||
android/.idea/misc.xml
|
||||
android/.idea/modules.xml
|
||||
android/.idea/scopes/scope_settings.xml
|
||||
android/.idea/vcs.xml
|
||||
android/*.iml
|
||||
|
||||
# Xcode
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.perspectivev3
|
||||
*.xcuserstate
|
||||
ios/Pods
|
||||
ios/build
|
||||
*project.xcworkspace*
|
||||
*xcuserdata*
|
||||
|
||||
# OS-specific files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.dbandroid/gradle
|
||||
android/gradlew
|
||||
android/build
|
||||
android/gradlew.bat
|
||||
android/gradle/
|
||||
|
||||
.idea
|
||||
coverage
|
||||
yarn.lock
|
||||
e2e/
|
||||
.github
|
||||
.vscode
|
||||
.nyc_output
|
||||
android/.settings
|
||||
*.coverage.json
|
||||
.circleci
|
||||
.eslintignore
|
||||
type-test.ts
|
||||
@@ -1,32 +0,0 @@
|
||||
Apache-2.0 License
|
||||
------------------
|
||||
|
||||
Copyright (c) 2016-present Invertase Limited <oss@invertase.io> & Contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this library except in compliance with the License.
|
||||
|
||||
You may obtain a copy of the Apache-2.0 License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Creative Commons Attribution 3.0 License
|
||||
----------------------------------------
|
||||
|
||||
Copyright (c) 2016-present Invertase Limited <oss@invertase.io> & Contributors
|
||||
|
||||
Documentation and other instructional materials provided for this project
|
||||
(including on a separate documentation repository or it's documentation website) are
|
||||
licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
|
||||
contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.
|
||||
|
||||
You may obtain a copy of the Creative Commons Attribution 3.0 License at
|
||||
|
||||
https://creativecommons.org/licenses/by/3.0/
|
||||
@@ -1,62 +0,0 @@
|
||||
<p align="center">
|
||||
<a href="https://invertase.io/oss/react-native-firebase">
|
||||
<img width="160px" src="https://i.imgur.com/JIyBtKW.png"><br/>
|
||||
</a>
|
||||
<h2 align="center">React Native Firebase - Utils</h2>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://api.rnfirebase.io/coverage/utils/detail"><img src="https://api.rnfirebase.io/coverage/utils/badge?style=flat-square" alt="Coverage"></a>
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/utils"><img src="https://img.shields.io/npm/dm/@react-native-firebase/utils.svg?style=flat-square" alt="NPM downloads"></a>
|
||||
<a href="https://www.npmjs.com/package/@react-native-firebase/utils"><img src="https://img.shields.io/npm/v/@react-native-firebase/utils.svg?style=flat-square" alt="NPM version"></a>
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/npm/l/react-native-firebase.svg?style=flat-square" alt="License"></a>
|
||||
<a href="https://lerna.js.org/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg?style=flat-square" alt="Maintained with Lerna"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://invertase.link/discord"><img src="https://img.shields.io/discord/295953187817521152.svg?style=flat-square&colorA=7289da&label=Chat%20on%20Discord" alt="Chat on Discord"></a>
|
||||
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/rnfirebase.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
> This is for the upcoming v6.0.0 release of React Native Firebase, please use the [react-native-firebase](https://www.npmjs.com/package/react-native-firebase) package instead, unless you're early adopting/testing the new packages - in which case please use the `latest` tagged patch-only release for this package.
|
||||
|
||||
A collection of utilities to aid in using Firebase and related services inside React Native, e.g. Test Lab helpers and Google Play Services version helpers.
|
||||
|
||||
[> Learn More](https://firebase.google.com/products/utils/)
|
||||
|
||||
## Installation
|
||||
|
||||
Requires `@react-native-firebase/app` to be installed.
|
||||
|
||||
```bash
|
||||
yarn add @react-native-firebase/utils
|
||||
react-native link @react-native-firebase/utils
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Guides](https://invertase.io/oss/react-native-firebase/guides?tags=utils)
|
||||
- [Installation](https://invertase.io/oss/react-native-firebase/v6/utils)
|
||||
- [Reference](https://invertase.io/oss/react-native-firebase/v6/utils/reference)
|
||||
|
||||
## License
|
||||
|
||||
- See [LICENSE](/LICENSE)
|
||||
|
||||
---
|
||||
|
||||
<p>
|
||||
<img align="left" width="75px" src="https://static.invertase.io/assets/invertase-logo-small.png">
|
||||
<p align="left">
|
||||
Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>.
|
||||
</p>
|
||||
<p align="left">
|
||||
<a href="https://invertase.io/hire-us">💼 Hire Us</a> |
|
||||
<a href="https://opencollective.com/react-native-firebase">☕️ Sponsor Us</a> |
|
||||
<a href="https://opencollective.com/jobs">💻 Work With Us</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
---
|
||||
@@ -1,22 +0,0 @@
|
||||
require 'json'
|
||||
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "RNFBUtils"
|
||||
s.version = package["version"]
|
||||
s.description = package["description"]
|
||||
s.summary = <<-DESC
|
||||
A well tested feature rich Firebase implementation for React Native, supporting iOS & Android.
|
||||
DESC
|
||||
s.homepage = "http://invertase.io/oss/react-native-firebase"
|
||||
s.license = package['license']
|
||||
s.authors = "Invertase Limited"
|
||||
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
|
||||
s.social_media_url = 'http://twitter.com/invertaseio'
|
||||
s.ios.deployment_target = "9.0"
|
||||
s.source_files = 'ios/**/*.{h,m}'
|
||||
s.dependency 'React'
|
||||
s.dependency 'Firebase/Core', '~> 6.5.0'
|
||||
s.dependency 'RNFBApp'
|
||||
s.static_framework = false
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
# editorconfig
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
@@ -1,61 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "io.invertase.gradle.build" version "1.3"
|
||||
}
|
||||
|
||||
project.ext {
|
||||
set('react-native', [
|
||||
versions: [
|
||||
android : [
|
||||
minSdk : 16,
|
||||
targetSdk : 28,
|
||||
compileSdk: 28,
|
||||
// optional as gradle.buildTools comes with one by default
|
||||
// overriding here though to match the version RN uses
|
||||
buildTools: "28.0.3"
|
||||
],
|
||||
|
||||
googlePlayServices: [
|
||||
base: "16.1.0",
|
||||
],
|
||||
],
|
||||
])
|
||||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
multiDexEnabled true
|
||||
}
|
||||
lintOptions {
|
||||
disable 'GradleCompatible'
|
||||
abortOnError false
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':@react-native-firebase_app')
|
||||
implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}"
|
||||
}
|
||||
|
||||
ReactNative.shared.applyPackageVersion()
|
||||
ReactNative.shared.applyDefaultExcludes()
|
||||
ReactNative.module.applyAndroidVersions()
|
||||
ReactNative.module.applyReactNativeDependency("api")
|
||||
@@ -1,6 +0,0 @@
|
||||
#Tue Oct 09 01:55:27 BST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
160
packages/utils/android/gradlew
vendored
160
packages/utils/android/gradlew
vendored
@@ -1,160 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
packages/utils/android/gradlew.bat
vendored
90
packages/utils/android/gradlew.bat
vendored
@@ -1,90 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<!-- Disable the given check in this project -->
|
||||
<issue id="GradleCompatible" severity="ignore" />
|
||||
</lint>
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = '@react-native-firebase_utils'
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="io.invertase.firebase.utils" />
|
||||
@@ -1,42 +0,0 @@
|
||||
package io.invertase.firebase.utils;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import com.facebook.react.ReactPackage;
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ReactNativeFirebaseUtilsPackage implements ReactPackage {
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new ReactNativeFirebaseUtilsModule(reactContext));
|
||||
return modules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
require 'json'
|
||||
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "RNFBUtils"
|
||||
s.version = package["version"]
|
||||
s.description = package["description"]
|
||||
s.summary = <<-DESC
|
||||
A well tested feature rich Firebase implementation for React Native, supporting iOS & Android.
|
||||
DESC
|
||||
s.homepage = "http://invertase.io/oss/react-native-firebase"
|
||||
s.license = package['license']
|
||||
s.authors = "Invertase Limited"
|
||||
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
|
||||
s.social_media_url = 'http://twitter.com/invertaseio'
|
||||
s.ios.deployment_target = "9.0"
|
||||
s.source_files = '**/*.{h,m}'
|
||||
s.dependency 'React'
|
||||
s.dependency 'Firebase/Core', '~> 6.5.0'
|
||||
s.dependency 'RNFBApp'
|
||||
s.static_framework = false
|
||||
end
|
||||
@@ -1,349 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 48;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2744B98621F45429004F8E3F /* RNFBUtilsModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBUtilsModule.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2744B98021F45429004F8E3F /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2744B98221F45429004F8E3F /* libRNFBUtils.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBUtils.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2744B98421F45429004F8E3F /* RNFBUtilsModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBUtilsModule.h; path = RNFBUtils/RNFBUtilsModule.h; sourceTree = SOURCE_ROOT; };
|
||||
2744B98521F45429004F8E3F /* RNFBUtilsModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBUtilsModule.m; path = RNFBUtils/RNFBUtilsModule.m; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2744B97F21F45429004F8E3F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2744B97521F452B8004F8E3F /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B98221F45429004F8E3F /* libRNFBUtils.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2744B98321F45429004F8E3F /* RNFBUtils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B9A121F48736004F8E3F /* converters */,
|
||||
2744B98C21F45C64004F8E3F /* common */,
|
||||
2744B98421F45429004F8E3F /* RNFBUtilsModule.h */,
|
||||
2744B98521F45429004F8E3F /* RNFBUtilsModule.m */,
|
||||
);
|
||||
path = RNFBUtils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3323F52AAFE26B7384BE4DE3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2744B98321F45429004F8E3F /* RNFBUtils */,
|
||||
2744B97521F452B8004F8E3F /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2744B98121F45429004F8E3F /* RNFBUtils */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBUtils" */;
|
||||
buildPhases = (
|
||||
2744B97E21F45429004F8E3F /* Sources */,
|
||||
2744B97F21F45429004F8E3F /* Frameworks */,
|
||||
2744B98021F45429004F8E3F /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RNFBUtils;
|
||||
productName = RNFBUtils;
|
||||
productReference = 2744B98221F45429004F8E3F /* libRNFBUtils.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
3323F95273A95DB34F55C6D7 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = RNFBUtils;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = Invertase;
|
||||
TargetAttributes = {
|
||||
2744B98121F45429004F8E3F = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBUtils" */;
|
||||
compatibilityVersion = "Xcode 8.0";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 3323F52AAFE26B7384BE4DE3;
|
||||
productRefGroup = 2744B97521F452B8004F8E3F /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2744B98121F45429004F8E3F /* RNFBUtils */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2744B97E21F45429004F8E3F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2744B98621F45429004F8E3F /* RNFBUtilsModule.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2744B98921F45429004F8E3F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2744B98A21F45429004F8E3F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3323F77D701E1896E6D239CF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${BUILT_PRODUCTS_DIR}/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"$(SRCROOT)/../../../ios/Pods/FirebaseUtils/Frameworks",
|
||||
"$(SRCROOT)/../../../tests/ios/Pods/FirebaseUtils/Frameworks",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(REACT_SEARCH_PATH)/React/**",
|
||||
"$(SRCROOT)/../../react-native/React/**",
|
||||
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
||||
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
||||
"$(SRCROOT)/../../../packages/app/ios/**",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACH_O_TYPE = staticlib;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3323F7E33E1559A2B9826720 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${BUILT_PRODUCTS_DIR}/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"$(SRCROOT)/../../../ios/Pods/FirebaseUtils/Frameworks",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(REACT_SEARCH_PATH)/React/**",
|
||||
"$(SRCROOT)/../../react-native/React/**",
|
||||
"$(SRCROOT)/../../react-native-firebase/ios/**",
|
||||
"$(FIREBASE_SEARCH_PATH)/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Firebase/**",
|
||||
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
||||
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
||||
"$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
|
||||
"$(SRCROOT)/../../../packages/app/ios/**",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MACH_O_TYPE = staticlib;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBUtils" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2744B98921F45429004F8E3F /* Debug */,
|
||||
2744B98A21F45429004F8E3F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBUtils" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3323F7E33E1559A2B9826720 /* Debug */,
|
||||
3323F77D701E1896E6D239CF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 3323F95273A95DB34F55C6D7 /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>FILEHEADER</key>
|
||||
<string>
|
||||
/**
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/</string>
|
||||
</dict>
|
||||
</plist>
|
||||
231
packages/utils/lib/index.d.ts
vendored
231
packages/utils/lib/index.d.ts
vendored
@@ -1,231 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import { ReactNativeFirebase } from '@react-native-firebase/app';
|
||||
|
||||
/**
|
||||
* React Native Firebase Utilities package.
|
||||
*
|
||||
* #### Example 1
|
||||
*
|
||||
* Access the firebase export from the `utils` package:
|
||||
*
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/utils';
|
||||
*
|
||||
* // firebase.utils().X
|
||||
* ```
|
||||
*
|
||||
* #### Example 2
|
||||
*
|
||||
* Using the default export from the `utils` package:
|
||||
*
|
||||
* ```js
|
||||
* import utils from '@react-native-firebase/utils';
|
||||
*
|
||||
* // utils().X
|
||||
* ```
|
||||
*
|
||||
* #### Example 3
|
||||
*
|
||||
* Using the default export from the `app` package:
|
||||
*
|
||||
* ```js
|
||||
* import firebase from '@react-native-firebase/app';
|
||||
* import '@react-native-firebase/utils';
|
||||
*
|
||||
* // firebase.utils().X
|
||||
* ```
|
||||
*
|
||||
* @firebase utils
|
||||
*/
|
||||
export namespace Utils {
|
||||
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
|
||||
|
||||
/**
|
||||
* A collection of native device file paths to aid in the usage of file path based methods.
|
||||
*
|
||||
* Concatenate a file path with your target file name when using with Storage `putFile` or `writeToFile`.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath;
|
||||
* ```
|
||||
*/
|
||||
export interface FilePath {
|
||||
/**
|
||||
* Returns an absolute path to the applications main bundle.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MAIN_BUNDLE;
|
||||
* ```
|
||||
*
|
||||
* @ios iOS only
|
||||
*/
|
||||
MAIN_BUNDLE: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the application specific cache directory on the filesystem.
|
||||
*
|
||||
* The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.CACHES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
CACHES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the users Documents directory.
|
||||
*
|
||||
* Use this directory to place documents that have been created by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.DOCUMENT_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
DOCUMENT_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a temporary directory.
|
||||
*
|
||||
* Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.TEMP_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
TEMP_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the apps library/resources directory.
|
||||
*
|
||||
* E.g. this can be used for things like documentation, support files, and configuration files and generic resources.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.LIBRARY_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
LIBRARY_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the directory on the primary shared/external storage device.
|
||||
*
|
||||
* Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the primary shared/external storage directory.
|
||||
*
|
||||
* Traditionally this is an SD card, but it may also be implemented as built-in storage on a device.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_STORAGE_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place pictures that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.PICTURES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
PICTURES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place movies that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MOVIES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
MOVIES_DIRECTORY: string;
|
||||
}
|
||||
|
||||
export interface Statics {
|
||||
FilePath: FilePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* The React Native Firebase Utils service interface.
|
||||
*
|
||||
* > This module is available for the default app only.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* Get the Utils service for the default app:
|
||||
*
|
||||
* ```js
|
||||
* const defaultAppUtils = firebase.utils();
|
||||
* ```
|
||||
*/
|
||||
export class Module extends FirebaseModule {
|
||||
/**
|
||||
* Returns true if this app is running inside a Firebase Test Lab environment. Always returns false on iOS.
|
||||
*
|
||||
* @android
|
||||
*/
|
||||
isRunningInTestLab: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/utils' {
|
||||
import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
|
||||
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
|
||||
|
||||
const firebaseNamedExport: {} & ReactNativeFirebaseModule;
|
||||
export const firebase = firebaseNamedExport;
|
||||
|
||||
const module: FirebaseModuleWithStatics<Utils.Module, Utils.Statics>;
|
||||
export default module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
declare module '@react-native-firebase/app' {
|
||||
namespace ReactNativeFirebase {
|
||||
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
|
||||
|
||||
interface Module {
|
||||
/**
|
||||
* Utils provides a collection of utilities to aid in using Firebase
|
||||
* and related services inside React Native, e.g. Test Lab helpers
|
||||
* and Google Play Services version helpers.
|
||||
*/
|
||||
utils: FirebaseModuleWithStatics<Utils.Module, Utils.Statics>;
|
||||
}
|
||||
|
||||
interface FirebaseApp {
|
||||
utils(): Utils.Module;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
/* eslint-disable import/no-duplicates */
|
||||
/*
|
||||
* Copyright (c) 2016-present Invertase Limited & Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this library except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
import type { ReactNativeFirebaseModule } from '@react-native-firebase/app-types/index.js.flow';
|
||||
|
||||
/**
|
||||
* A collection of native device file paths to aid in the usage of file path based methods.
|
||||
*
|
||||
* Concatenate a file path with your target file name when using with Storage `putFile` or `writeToFile`.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath;
|
||||
* ```
|
||||
*/
|
||||
export interface FilePath {
|
||||
/**
|
||||
* Returns an absolute path to the applications main bundle.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MAIN_BUNDLE;
|
||||
* ```
|
||||
*
|
||||
* @ios iOS only
|
||||
*/
|
||||
MAIN_BUNDLE: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the application specific cache directory on the filesystem.
|
||||
*
|
||||
* The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.CACHES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
CACHES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the users Documents directory.
|
||||
*
|
||||
* Use this directory to place documents that have been created by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.DOCUMENT_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
DOCUMENT_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a temporary directory.
|
||||
*
|
||||
* Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.TEMP_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
TEMP_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the apps library/resources directory.
|
||||
*
|
||||
* E.g. this can be used for things like documentation, support files, and configuration files and generic resources.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.LIBRARY_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
LIBRARY_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the directory on the primary shared/external storage device.
|
||||
*
|
||||
* Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to the primary shared/external storage directory.
|
||||
*
|
||||
* Traditionally this is an SD card, but it may also be implemented as built-in storage on a device.
|
||||
*
|
||||
* Returns null if no external storage directory found, e.g. removable media has been ejected by the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY;
|
||||
* ```
|
||||
*
|
||||
* @android Android only - iOS returns null
|
||||
*/
|
||||
EXTERNAL_STORAGE_DIRECTORY: string | null;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place pictures that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.PICTURES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
PICTURES_DIRECTORY: string;
|
||||
|
||||
/**
|
||||
* Returns an absolute path to a directory in which to place movies that are available to the user.
|
||||
*
|
||||
* ```js
|
||||
* firebase.utils.FilePath.MOVIES_DIRECTORY;
|
||||
* ```
|
||||
*/
|
||||
MOVIES_DIRECTORY: string;
|
||||
}
|
||||
|
||||
export interface Statics {
|
||||
FilePath: FilePath;
|
||||
}
|
||||
|
||||
export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Returns true if this app is running inside a Firebase Test Lab environment. Always returns false on iOS.
|
||||
*
|
||||
* @android
|
||||
*/
|
||||
isRunningInTestLab: boolean;
|
||||
}
|
||||
|
||||
declare module '@react-native-firebase/utils' {
|
||||
import type {
|
||||
ReactNativeFirebaseNamespace,
|
||||
ReactNativeFirebaseModuleAndStatics,
|
||||
} from '@react-native-firebase/app-types/index.js.flow';
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import { firebase } from '@react-native-firebase/utils';
|
||||
* firebase.utils().X(...);
|
||||
* ```
|
||||
*/
|
||||
declare export var firebase: {} & ReactNativeFirebaseNamespace;
|
||||
|
||||
/**
|
||||
* @example
|
||||
* ```js
|
||||
* import utils from '@react-native-firebase/utils';
|
||||
* utils().X(...);
|
||||
* ```
|
||||
*/
|
||||
declare export default ReactNativeFirebaseModuleAndStatics<Module, Statics>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
||||
*/
|
||||
declare module '@react-native-firebase/app-types' {
|
||||
import type { ReactNativeFirebaseModuleAndStatics } from '@react-native-firebase/app-types/index.js.flow';
|
||||
|
||||
declare interface ReactNativeFirebaseNamespace {
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
utils: ReactNativeFirebaseModuleAndStatics<Module, Statics>;
|
||||
}
|
||||
|
||||
declare interface FirebaseApp {
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
utils(): Module;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "@react-native-firebase/utils",
|
||||
"version": "0.2.3",
|
||||
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
||||
"description": "React Native Firebase - Utils",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "genversion --semi lib/version.js",
|
||||
"build:clean": "rimraf android/build && rimraf ios/build",
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/invertase/react-native-firebase/tree/master/packages/utils"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-native",
|
||||
"firebase",
|
||||
"test lab",
|
||||
"google play services",
|
||||
"android",
|
||||
"ios",
|
||||
"utils"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@react-native-firebase/app": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-firebase/app-types": "0.2.3"
|
||||
},
|
||||
"gitHead": "889bf5379c8ce5257b33fb3ad1ac9c905fe26fff",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import firebase from '@react-native-firebase/app';
|
||||
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/utils';
|
||||
|
||||
// checks module exists at root
|
||||
console.log(firebase.utils().app.name);
|
||||
|
||||
// checks module exists at app level
|
||||
console.log(firebase.app().utils().app.name);
|
||||
|
||||
// checks statics exist
|
||||
console.log(firebase.utils.SDK_VERSION);
|
||||
|
||||
// checks statics exist on defaultExport
|
||||
console.log(defaultExport.SDK_VERSION);
|
||||
|
||||
// checks root exists
|
||||
console.log(firebase.SDK_VERSION);
|
||||
|
||||
// checks firebase named export exists on module
|
||||
console.log(firebaseFromModule.SDK_VERSION);
|
||||
|
||||
// checks multi-app support exists
|
||||
// console.log(firebase.utils(firebase.app()).app.name);
|
||||
|
||||
// checks default export supports app arg
|
||||
// console.log(defaultExport(firebase.app()).app.name);
|
||||
34
tests/app.js
34
tests/app.js
@@ -15,32 +15,30 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { AppRegistry, Image, NativeModules, StyleSheet, Text, View } from 'react-native';
|
||||
|
||||
import jet from 'jet/platform/react-native';
|
||||
import NativeEventEmitter from '@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter';
|
||||
|
||||
import '@react-native-firebase/admob';
|
||||
import '@react-native-firebase/firestore';
|
||||
import '@react-native-firebase/auth';
|
||||
import '@react-native-firebase/database';
|
||||
import '@react-native-firebase/analytics';
|
||||
import '@react-native-firebase/remote-config';
|
||||
import '@react-native-firebase/utils';
|
||||
import '@react-native-firebase/dynamic-links';
|
||||
import firebase from '@react-native-firebase/app';
|
||||
import NativeEventEmitter from '@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter';
|
||||
import '@react-native-firebase/app/lib/utils';
|
||||
import '@react-native-firebase/auth';
|
||||
import '@react-native-firebase/crashlytics';
|
||||
import '@react-native-firebase/in-app-messaging';
|
||||
import '@react-native-firebase/database';
|
||||
import '@react-native-firebase/dynamic-links';
|
||||
import '@react-native-firebase/firestore';
|
||||
import '@react-native-firebase/functions';
|
||||
import '@react-native-firebase/iid';
|
||||
import '@react-native-firebase/in-app-messaging';
|
||||
import '@react-native-firebase/indexing';
|
||||
import '@react-native-firebase/invites';
|
||||
import '@react-native-firebase/messaging';
|
||||
import '@react-native-firebase/ml-natural-language';
|
||||
import '@react-native-firebase/ml-vision';
|
||||
import '@react-native-firebase/storage';
|
||||
import '@react-native-firebase/iid';
|
||||
import '@react-native-firebase/indexing';
|
||||
import '@react-native-firebase/invites';
|
||||
import '@react-native-firebase/perf';
|
||||
import firebase from '@react-native-firebase/app';
|
||||
import '@react-native-firebase/remote-config';
|
||||
import '@react-native-firebase/storage';
|
||||
import jet from 'jet/platform/react-native';
|
||||
import React, { Component } from 'react';
|
||||
import { AppRegistry, Image, NativeModules, StyleSheet, Text, View } from 'react-native';
|
||||
|
||||
jet.exposeContextProperty('NativeModules', NativeModules);
|
||||
jet.exposeContextProperty('NativeEventEmitter', NativeEventEmitter);
|
||||
|
||||
@@ -461,10 +461,6 @@ PODS:
|
||||
- Firebase/Storage (~> 6.5.0)
|
||||
- React
|
||||
- RNFBApp
|
||||
- RNFBUtils (0.2.3):
|
||||
- Firebase/Core (~> 6.5.0)
|
||||
- React
|
||||
- RNFBApp
|
||||
- yoga (0.60.4.React)
|
||||
|
||||
DEPENDENCIES:
|
||||
@@ -507,7 +503,6 @@ DEPENDENCIES:
|
||||
- "RNFBPerf (from `../node_modules/@react-native-firebase/perf/ios`)"
|
||||
- "RNFBRemoteConfig (from `../node_modules/@react-native-firebase/remote-config/ios`)"
|
||||
- "RNFBStorage (from `../node_modules/@react-native-firebase/storage/ios`)"
|
||||
- "RNFBUtils (from `../node_modules/@react-native-firebase/utils/ios`)"
|
||||
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)
|
||||
|
||||
SPEC REPOS:
|
||||
@@ -636,8 +631,6 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/@react-native-firebase/remote-config/ios"
|
||||
RNFBStorage:
|
||||
:path: "../node_modules/@react-native-firebase/storage/ios"
|
||||
RNFBUtils:
|
||||
:path: "../node_modules/@react-native-firebase/utils/ios"
|
||||
yoga:
|
||||
:path: "../node_modules/react-native/ReactCommon/yoga"
|
||||
|
||||
@@ -725,7 +718,6 @@ SPEC CHECKSUMS:
|
||||
RNFBPerf: 47d1afb0c25cc4987dd979d463b5a25dbb81ecbb
|
||||
RNFBRemoteConfig: e62acf099b0e1026a6cc085006c8415022b8e6ac
|
||||
RNFBStorage: fd285de854aca892a13126a6cb491376f33a4bb7
|
||||
RNFBUtils: feebcf438235a3afa770a30e9eef6f414c070ec8
|
||||
yoga: c2c050f6ae6e222534760cc82f559b89214b67e2
|
||||
|
||||
PODFILE CHECKSUM: 0142c48fc8ad8e230e216fc15af267405c520250
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"@react-native-firebase/perf": "0.2.3",
|
||||
"@react-native-firebase/remote-config": "0.2.3",
|
||||
"@react-native-firebase/storage": "0.2.3",
|
||||
"@react-native-firebase/utils": "0.2.3",
|
||||
"react": "16.8.6",
|
||||
"react-native": "0.60.4"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user