This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

45 lines
2.0 KiB
JavaScript
Raw Normal View History

2021-04-02 02:24:13 +03:00
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const WarningAggregator = __importStar(require("../../utils/warnings"));
const core_plugins_1 = require("../core-plugins");
const ios_plugins_1 = require("../ios-plugins");
const static_plugins_1 = require("../static-plugins");
const packageName = 'expo-document-picker';
const withICloudEntitlement = (config, { appleTeamId }) => {
return ios_plugins_1.withEntitlementsPlist(config, config => {
config.modResults = setICloudEntitlement(config, config.modResults, appleTeamId);
return config;
});
};
function setICloudEntitlement(config, entitlementsPlist, appleTeamId) {
var _a;
if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) {
// TODO: need access to the appleTeamId for this one!
WarningAggregator.addWarningIOS('ios.usesIcloudStorage', 'Enable the iCloud Storage Entitlement from the Capabilities tab in your Xcode project.'
// TODO: add a link to a docs page with more information on how to do this
);
}
return entitlementsPlist;
}
const withUnversionedDocumentPicker = core_plugins_1.createRunOncePlugin(config => {
// No mechanism to get Apple Team ID.
config = withICloudEntitlement(config, { appleTeamId: 'TODO-GET-APPLE-TEAM-ID' });
return config;
}, packageName);
const withDocumentPicker = config => {
return static_plugins_1.withStaticPlugin(config, {
_isLegacyPlugin: true,
plugin: packageName,
// If the static plugin isn't found, use the unversioned one.
fallback: withUnversionedDocumentPicker,
});
};
exports.default = withDocumentPicker;
//# sourceMappingURL=expo-document-picker.js.map