UNPKG

react-native-firebase-compiled

Version:

A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto

195 lines (140 loc) 6.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.utils = exports.storage = exports.perf = exports.notifications = exports.messaging = exports.links = exports.invites = exports.iid = exports.functions = exports.firestore = exports.database = exports.crashlytics = exports.config = exports.auth = exports.analytics = exports.admob = exports.default = void 0; var _reactNative = require("react-native"); var _apps = _interopRequireDefault(require("../../utils/apps")); var _internals = _interopRequireDefault(require("../../utils/internals")); var _app = _interopRequireDefault(require("./app")); var _version = _interopRequireDefault(require("../../version")); var _admob = require("../admob"); var _auth = require("../auth"); var _analytics = require("../analytics"); var _config = require("../config"); var _crashlytics = require("../crashlytics"); var _database = require("../database"); var _firestore = require("../firestore"); var _functions = require("../functions"); var _iid = require("../iid"); var _invites = require("../invites"); var _links = require("../links"); var _messaging = require("../messaging"); var _notifications = require("../notifications"); var _perf = require("../perf"); var _storage = require("../storage"); var _utils = require("../utils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } const FirebaseCoreModule = _reactNative.NativeModules.RNFirebase; class Firebase { constructor() { _defineProperty(this, "admob", void 0); _defineProperty(this, "analytics", void 0); _defineProperty(this, "auth", void 0); _defineProperty(this, "config", void 0); _defineProperty(this, "crashlytics", void 0); _defineProperty(this, "database", void 0); _defineProperty(this, "firestore", void 0); _defineProperty(this, "functions", void 0); _defineProperty(this, "iid", void 0); _defineProperty(this, "invites", void 0); _defineProperty(this, "links", void 0); _defineProperty(this, "messaging", void 0); _defineProperty(this, "notifications", void 0); _defineProperty(this, "perf", void 0); _defineProperty(this, "storage", void 0); _defineProperty(this, "utils", void 0); if (!FirebaseCoreModule) { throw new Error(_internals.default.STRINGS.ERROR_MISSING_CORE); } _apps.default.initializeNativeApps(); // modules this.admob = _apps.default.moduleAndStatics('admob', _admob.statics, _admob.MODULE_NAME); this.analytics = _apps.default.moduleAndStatics('analytics', _analytics.statics, _analytics.MODULE_NAME); this.auth = _apps.default.moduleAndStatics('auth', _auth.statics, _auth.MODULE_NAME); this.config = _apps.default.moduleAndStatics('config', _config.statics, _config.MODULE_NAME); this.crashlytics = _apps.default.moduleAndStatics('crashlytics', _crashlytics.statics, _crashlytics.MODULE_NAME); this.database = _apps.default.moduleAndStatics('database', _database.statics, _database.MODULE_NAME); this.firestore = _apps.default.moduleAndStatics('firestore', _firestore.statics, _firestore.MODULE_NAME); this.functions = _apps.default.moduleAndStatics('functions', _functions.statics, _functions.MODULE_NAME); this.iid = _apps.default.moduleAndStatics('iid', _iid.statics, _iid.MODULE_NAME); this.invites = _apps.default.moduleAndStatics('invites', _invites.statics, _invites.MODULE_NAME); this.links = _apps.default.moduleAndStatics('links', _links.statics, _links.MODULE_NAME); this.messaging = _apps.default.moduleAndStatics('messaging', _messaging.statics, _messaging.MODULE_NAME); this.notifications = _apps.default.moduleAndStatics('notifications', _notifications.statics, _notifications.MODULE_NAME); this.perf = _apps.default.moduleAndStatics('perf', _perf.statics, _perf.MODULE_NAME); this.storage = _apps.default.moduleAndStatics('storage', _storage.statics, _storage.MODULE_NAME); this.utils = _apps.default.moduleAndStatics('utils', _utils.statics, _utils.MODULE_NAME); } /** * Web SDK initializeApp * * @param options * @param name * @return {*} */ initializeApp(options, name) { return _apps.default.initializeApp(options, name); } /** * Retrieves a Firebase app instance. * * When called with no arguments, the default app is returned. * When an app name is provided, the app corresponding to that name is returned. * * @param name * @return {*} */ app(name) { return _apps.default.app(name); } /** * A (read-only) array of all initialized apps. * @return {Array} */ get apps() { return _apps.default.apps(); } /** * The current SDK version. * @return {string} */ get SDK_VERSION() { return _version.default; } } const firebaseApp = new Firebase(); var _default = firebaseApp; exports.default = _default; const admob = firebaseApp.admob, analytics = firebaseApp.analytics, auth = firebaseApp.auth, config = firebaseApp.config, crashlytics = firebaseApp.crashlytics, database = firebaseApp.database, firestore = firebaseApp.firestore, functions = firebaseApp.functions, iid = firebaseApp.iid, invites = firebaseApp.invites, links = firebaseApp.links, messaging = firebaseApp.messaging, notifications = firebaseApp.notifications, perf = firebaseApp.perf, storage = firebaseApp.storage, utils = firebaseApp.utils; exports.utils = utils; exports.storage = storage; exports.perf = perf; exports.notifications = notifications; exports.messaging = messaging; exports.links = links; exports.invites = invites; exports.iid = iid; exports.functions = functions; exports.firestore = firestore; exports.database = database; exports.crashlytics = crashlytics; exports.config = config; exports.auth = auth; exports.analytics = analytics; exports.admob = admob;