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

133 lines (101 loc) 2.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _reactNative = require("react-native"); var _AndroidInvitation = _interopRequireDefault(require("./AndroidInvitation")); 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; } class Invitation { constructor(title, message) { _defineProperty(this, "_android", void 0); _defineProperty(this, "_androidClientId", void 0); _defineProperty(this, "_androidMinimumVersionCode", void 0); _defineProperty(this, "_callToActionText", void 0); _defineProperty(this, "_customImage", void 0); _defineProperty(this, "_deepLink", void 0); _defineProperty(this, "_iosClientId", void 0); _defineProperty(this, "_message", void 0); _defineProperty(this, "_title", void 0); this._android = new _AndroidInvitation.default(this); this._message = message; this._title = title; } get android() { return this._android; } /** * * @param androidClientId * @returns {Invitation} */ setAndroidClientId(androidClientId) { this._androidClientId = androidClientId; return this; } /** * * @param androidMinimumVersionCode * @returns {Invitation} */ setAndroidMinimumVersionCode(androidMinimumVersionCode) { this._androidMinimumVersionCode = androidMinimumVersionCode; return this; } /** * * @param callToActionText * @returns {Invitation} */ setCallToActionText(callToActionText) { this._callToActionText = callToActionText; return this; } /** * * @param customImage * @returns {Invitation} */ setCustomImage(customImage) { this._customImage = customImage; return this; } /** * * @param deepLink * @returns {Invitation} */ setDeepLink(deepLink) { this._deepLink = deepLink; return this; } /** * * @param iosClientId * @returns {Invitation} */ setIOSClientId(iosClientId) { this._iosClientId = iosClientId; return this; } build() { if (!this._message) { throw new Error('Invitation: Missing required `message` property'); } else if (!this._title) { throw new Error('Invitation: Missing required `title` property'); } return { android: _reactNative.Platform.OS === 'android' ? this._android.build() : undefined, androidClientId: this._androidClientId, androidMinimumVersionCode: this._androidMinimumVersionCode, callToActionText: this._callToActionText, customImage: this._customImage, deepLink: this._deepLink, iosClientId: this._iosClientId, message: this._message, title: this._title }; } } exports.default = Invitation;