[both] re-enabled analytics, admob, crash & perf modules

This commit is contained in:
Salakar 2017-07-12 16:11:07 +01:00
parent fc84452915
commit 91b7281d45
4 changed files with 41 additions and 12 deletions

View File

@ -2,16 +2,11 @@ import { NativeModules } from 'react-native';
import INTERNALS from './internals';
// modules
// todo
import AdMob, { statics as AdMobStatics } from './modules/admob';
import Auth, { statics as AuthStatics } from './modules/auth';
import Analytics from './modules/analytics';
import Crash from './modules/crash';
import Performance from './modules/perf';
import Analytics from './modules/analytics';
import AdMob, { statics as AdMobStatics } from './modules/admob';
// ----
import Auth, { statics as AuthStatics } from './modules/auth';
import RemoteConfig from './modules/config';
import Storage, { statics as StorageStatics } from './modules/storage';
import Database, { statics as DatabaseStatics } from './modules/database';
@ -56,14 +51,26 @@ export default class FirebaseApp {
* MODULES
*/
get admob() {
return this._staticsOrModuleInstance('admob', AdMobStatics, AdMob);
}
get auth() {
return this._staticsOrModuleInstance('auth', AuthStatics, Auth);
}
get analytics() {
return this._staticsOrModuleInstance('analytics', {}, Analytics);
}
get config() {
return this._staticsOrModuleInstance('config', {}, RemoteConfig);
}
get crash() {
return this._staticsOrModuleInstance('crash', {}, Crash);
}
get database() {
return this._staticsOrModuleInstance('database', DatabaseStatics, Database);
}
@ -72,6 +79,10 @@ export default class FirebaseApp {
return this._staticsOrModuleInstance('messaging', MessagingStatics, Messaging);
}
get perf() {
return this._staticsOrModuleInstance('perf', {}, Performance);
}
get storage() {
return this._staticsOrModuleInstance('storage', StorageStatics, Storage);
}

View File

@ -11,7 +11,11 @@ import PACKAGE from './../package.json';
import FirebaseApp from './firebase-app';
// module imports
import AdMob, { statics as AdMobStatics } from './modules/admob';
import Auth, { statics as AuthStatics } from './modules/auth';
import Analytics from './modules/analytics';
import Crash from './modules/crash';
import Performance from './modules/perf';
import RemoteConfig from './modules/config';
import Storage, { statics as StorageStatics } from './modules/storage';
import Database, { statics as DatabaseStatics } from './modules/database';
@ -92,7 +96,7 @@ class FirebaseCore {
* @android
* @return {RNFirebase.GoogleApiAvailabilityType|{isAvailable: boolean, status: number}}
*/
get googleApiAvailabilty(): GoogleApiAvailabilityType {
get googleApiAvailability(): GoogleApiAvailabilityType {
return FirebaseCoreModule.googleApiAvailability || { isAvailable: true, status: 0 };
}
@ -100,14 +104,26 @@ class FirebaseCore {
* MODULES
*/
get admob() {
return this._appNamespaceOrStatics('admob', AdMobStatics, AdMob);
}
get auth() {
return this._appNamespaceOrStatics('auth', AuthStatics, Auth);
}
get analytics() {
return this._appNamespaceOrStatics('analytics', {}, Analytics);
}
get config() {
return this._appNamespaceOrStatics('config', {}, RemoteConfig);
}
get crash() {
return this._appNamespaceOrStatics('crash', {}, Crash);
}
get database() {
return this._appNamespaceOrStatics('database', DatabaseStatics, Database);
@ -117,6 +133,10 @@ class FirebaseCore {
return this._appNamespaceOrStatics('messaging', MessagingStatics, Messaging);
}
get perf() {
return this._appNamespaceOrStatics('perf', DatabaseStatics, Performance);
}
get storage() {
return this._appNamespaceOrStatics('storage', StorageStatics, Storage);
}

View File

@ -4,7 +4,7 @@ import ModuleBase from '../../utils/ModuleBase';
export default class PerformanceMonitoring extends ModuleBase {
constructor(firebaseApp: Object, options: Object = {}) {
super(firebaseApp, options, 'Perf');
super(firebaseApp, options, 'Performance');
}
/**

View File

@ -3,7 +3,6 @@ import { Provider } from 'react-redux';
import CoreContainer from './containers/CoreContainer';
import setupStore from './store/setup';
import { setupSuites } from './tests/index';
import { NativeModules } from 'react-native';
global.Promise = require('bluebird');
@ -36,7 +35,6 @@ function bootstrap() {
state: State;
componentDidMount() {
console.warn(JSON.stringify(Object.keys(NativeModules)));
setupStore((store) => {
setupSuites(store);
this.setState({