react-native-integrate
Version:
Automate integration of additional code into React Native projects
42 lines (41 loc) • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addCommonCapability = addCommonCapability;
const applyObjectModification_1 = require("../../utils/applyObjectModification");
const plistTask_1 = require("../plistTask");
function addCommonCapability(args) {
let plistContent = (0, plistTask_1.readPListContent)(args.targetName, args.filename, true);
const capabilityValues = commonCapabilityValues[args.capability];
plistContent = (0, applyObjectModification_1.applyObjectModification)(plistContent, {
set: capabilityValues,
strategy: 'merge_distinct',
});
(0, plistTask_1.writePListContent)(plistContent, args.targetName, args.filename);
}
const commonCapabilityValues = {
push: {
'aps-environment': 'development',
},
'wireless-configuration': {
'com.apple.external-accessory.wireless-configuration': true,
},
'app-attest': {
'com.apple.developer.devicecheck.appattest-environment': 'development',
},
'data-protection': {
'com.apple.developer.default-data-protection': 'NSFileProtectionComplete',
},
homekit: {
'com.apple.developer.homekit': true,
},
healthkit: {
'com.apple.developer.healthkit': true,
'com.apple.developer.healthkit.access': [],
},
'inter-app-audio': {
'inter-app-audio': true,
},
'increased-memory': {
'com.apple.developer.kernel.increased-memory-limit': true,
},
};