[js][internals] _NATIVE_MODULE mapping for `nativeModuleExists`
This commit is contained in:
parent
202ad29f1c
commit
b4cdbef593
|
@ -129,7 +129,7 @@ export default class FirebaseApp {
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(getInstance, statics, {
|
Object.assign(getInstance, statics, {
|
||||||
nativeModuleExists: !!NativeModules[`RNFirebase${capitalizeFirstLetter(name)}`],
|
nativeModuleExists: !!NativeModules[`RNFirebase${InstanceClass._NATIVE_MODULE || capitalizeFirstLetter(name)}`],
|
||||||
});
|
});
|
||||||
|
|
||||||
return getInstance;
|
return getInstance;
|
||||||
|
|
|
@ -201,10 +201,11 @@ class FirebaseCore {
|
||||||
*
|
*
|
||||||
* @param namespace
|
* @param namespace
|
||||||
* @param statics
|
* @param statics
|
||||||
|
* @param InstanceClass
|
||||||
* @return {function(FirebaseApp=)}
|
* @return {function(FirebaseApp=)}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_appNamespaceOrStatics(namespace, statics = {}): Function {
|
_appNamespaceOrStatics(namespace, statics = {}, InstanceClass): Function {
|
||||||
const getNamespace = (app?: FirebaseApp) => {
|
const getNamespace = (app?: FirebaseApp) => {
|
||||||
let _app = app;
|
let _app = app;
|
||||||
// throw an error if it's not a valid app instance
|
// throw an error if it's not a valid app instance
|
||||||
|
@ -217,7 +218,7 @@ class FirebaseCore {
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(getNamespace, statics, {
|
Object.assign(getNamespace, statics, {
|
||||||
nativeModuleExists: !!NativeModules[`RNFirebase${capitalizeFirstLetter(namespace)}`],
|
nativeModuleExists: !!NativeModules[`RNFirebase${InstanceClass._NATIVE_MODULE || capitalizeFirstLetter(namespace)}`],
|
||||||
});
|
});
|
||||||
return getNamespace;
|
return getNamespace;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,11 @@ import Banner from './Banner';
|
||||||
import NativeExpress from './NativeExpress';
|
import NativeExpress from './NativeExpress';
|
||||||
|
|
||||||
|
|
||||||
export default class Admob extends ModuleBase {
|
export default class AdMob extends ModuleBase {
|
||||||
|
static _NATIVE_MODULE = 'AdMob';
|
||||||
|
|
||||||
constructor(firebaseApp: Object, options: Object = {}) {
|
constructor(firebaseApp: Object, options: Object = {}) {
|
||||||
super(firebaseApp, options, 'AdMob', true);
|
super(firebaseApp, options, AdMob._NATIVE_MODULE, true);
|
||||||
|
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
this._appId = null;
|
this._appId = null;
|
||||||
|
|
|
@ -7,8 +7,9 @@ import ModuleBase from './../../utils/ModuleBase';
|
||||||
* @class Config
|
* @class Config
|
||||||
*/
|
*/
|
||||||
export default class RemoteConfig extends ModuleBase {
|
export default class RemoteConfig extends ModuleBase {
|
||||||
|
static _NATIVE_MODULE = 'RemoteConfig';
|
||||||
constructor(firebaseApp: Object, options: Object = {}) {
|
constructor(firebaseApp: Object, options: Object = {}) {
|
||||||
super(firebaseApp, options, 'RemoteConfig');
|
super(firebaseApp, options, RemoteConfig._NATIVE_MODULE);
|
||||||
this.developerModeEnabled = false;
|
this.developerModeEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue