mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-12 17:58:40 +08:00
[android][utils] new utils() module - home of all non firebase utilities and library configuration options, including play services availability checks
This commit is contained in:
@@ -4,11 +4,9 @@
|
||||
*/
|
||||
import { NativeModules, NativeEventEmitter } from 'react-native';
|
||||
|
||||
import { isObject, isString } from './utils';
|
||||
|
||||
import INTERNALS from './internals';
|
||||
import PACKAGE from './../package.json';
|
||||
import FirebaseApp from './firebase-app';
|
||||
import { isObject, isString } from './utils';
|
||||
|
||||
// module imports
|
||||
import AdMob, { statics as AdMobStatics } from './modules/admob';
|
||||
@@ -21,6 +19,7 @@ import Storage, { statics as StorageStatics } from './modules/storage';
|
||||
import Database, { statics as DatabaseStatics } from './modules/database';
|
||||
import Messaging, { statics as MessagingStatics } from './modules/messaging';
|
||||
import Firestore, { statics as FirestoreStatics } from './modules/firestore';
|
||||
import Utils, { statics as UtilsStatics } from './modules/utils';
|
||||
|
||||
const FirebaseCoreModule = NativeModules.RNFirebase;
|
||||
|
||||
@@ -52,6 +51,7 @@ class FirebaseCore {
|
||||
this.messaging = this._appNamespaceOrStatics(MessagingStatics, Messaging);
|
||||
this.perf = this._appNamespaceOrStatics(DatabaseStatics, Performance);
|
||||
this.storage = this._appNamespaceOrStatics(StorageStatics, Storage);
|
||||
this.utils = this._appNamespaceOrStatics(UtilsStatics, Utils);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,42 +139,6 @@ class FirebaseCore {
|
||||
return Object.values(INTERNALS.APPS);
|
||||
}
|
||||
|
||||
/**
|
||||
* The current RNFirebase SDK version.
|
||||
*/
|
||||
get SDK_VERSION() {
|
||||
return PACKAGE.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* The platform specific default app name
|
||||
*/
|
||||
get DEFAULT_APP_NAME() {
|
||||
return INTERNALS.STRINGS.DEFAULT_APP_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns props from the android GoogleApiAvailability sdk
|
||||
* @android
|
||||
* @return {RNFirebase.GoogleApiAvailabilityType|{isAvailable: boolean, status: number}}
|
||||
*/
|
||||
get googleApiAvailability(): GoogleApiAvailabilityType {
|
||||
return FirebaseCoreModule.googleApiAvailability || { isAvailable: true, status: 0 };
|
||||
}
|
||||
|
||||
/*
|
||||
* CONFIG METHODS
|
||||
*/
|
||||
/**
|
||||
* Set the global logging level for all logs.
|
||||
*
|
||||
* @param booleanOrDebugString
|
||||
*/
|
||||
setLogLevel(booleanOrDebugString) {
|
||||
INTERNALS.OPTIONS.logLevel = booleanOrDebugString;
|
||||
Log.setLevel(booleanOrDebugString);
|
||||
}
|
||||
|
||||
/*
|
||||
* INTERNALS
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user