UNPKG

@lazidog/expo-notification-extension

Version:

| [with FCM compatibility] The Expo Notification Service Extension plugin allows you to add a Notification Service Extension file while staying in the managed workflow.

46 lines (45 loc) 3.22 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports, "__esModule", { value: true }); var constants_1 = require("../constants"); /** * Makes it possible for EAS CLI to know what app extensions exist before the build starts * (before the Xcode project has been generated) to ensure that * the required credentials are generated and validated. * @link https://docs.expo.dev/build-reference/app-extensions/#managed-projects-experimental-support */ var withEasAppExtension = function (config) { var _a; var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; var bundleIdentifier = "".concat((_b = config.ios) === null || _b === void 0 ? void 0 : _b.bundleIdentifier, ".").concat(constants_1.EXTENSION_NAME); var expoAppExtension = { targetName: constants_1.EXTENSION_NAME, bundleIdentifier: bundleIdentifier, entitlements: (_a = {}, _a[constants_1.APP_GROUP_KEY] = ["group.".concat((_c = config === null || config === void 0 ? void 0 : config.ios) === null || _c === void 0 ? void 0 : _c.bundleIdentifier, ".nse")], _a), }; return __assign(__assign({}, config), { extra: __assign(__assign({}, config.extra), { eas: __assign(__assign({}, (_d = config.extra) === null || _d === void 0 ? void 0 : _d.eas), { build: __assign(__assign({}, (_f = (_e = config.extra) === null || _e === void 0 ? void 0 : _e.eas) === null || _f === void 0 ? void 0 : _f.build), { experimental: __assign(__assign({}, (_j = (_h = (_g = config.extra) === null || _g === void 0 ? void 0 : _g.eas) === null || _h === void 0 ? void 0 : _h.build) === null || _j === void 0 ? void 0 : _j.experimental), { ios: __assign(__assign({}, (_o = (_m = (_l = (_k = config.extra) === null || _k === void 0 ? void 0 : _k.eas) === null || _l === void 0 ? void 0 : _l.build) === null || _m === void 0 ? void 0 : _m.experimental) === null || _o === void 0 ? void 0 : _o.ios), { appExtensions: __spreadArray(__spreadArray([], ((_u = (_t = (_s = (_r = (_q = (_p = config.extra) === null || _p === void 0 ? void 0 : _p.eas) === null || _q === void 0 ? void 0 : _q.build) === null || _r === void 0 ? void 0 : _r.experimental) === null || _s === void 0 ? void 0 : _s.ios) === null || _t === void 0 ? void 0 : _t.appExtensions) !== null && _u !== void 0 ? _u : []), true), [ expoAppExtension, ], false) }) }) }) }) }) }); }; exports.default = withEasAppExtension;