examples/cordova1/plugins/branch-cordova-sdk/src/scripts/ios/enableEntitlements.js
function activateAssociativeDomains(xcodeProject, entitlementsFile) {
    const configurations = removeComments(
      xcodeProject.pbxXCBuildConfigurationSection()
    );
    let config;
    let buildSettings;

    for (config in configurations) {
      buildSettings = configurations[config].buildSettings;
      buildSettings.CODE_SIGN_IDENTITY = `"${CODESIGNIDENTITY}"`;
      buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsFile}"`;

      // if deployment target is less then the required one - increase it
      if (buildSettings.IPHONEOS_DEPLOYMENT_TARGET) {
        const buildDeploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET.toString();
        if (compare(buildDeploymentTarget, IOS_DEPLOYMENT_TARGET) === -1) {
          buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
        }
      } else {
        buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
      }
    }
  }
function activateAssociativeDomains(xcodeProject, entitlementsFile) {
    const configurations = removeComments(
      xcodeProject.pbxXCBuildConfigurationSection()
    );
    let config;
    let buildSettings;

    for (config in configurations) {
      buildSettings = configurations[config].buildSettings;
      buildSettings.CODE_SIGN_IDENTITY = `"${CODESIGNIDENTITY}"`;
      buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsFile}"`;

      // if deployment target is less then the required one - increase it
      if (buildSettings.IPHONEOS_DEPLOYMENT_TARGET) {
        const buildDeploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET.toString();
        if (compare(buildDeploymentTarget, IOS_DEPLOYMENT_TARGET) === -1) {
          buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
        }
      } else {
        buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET;
      }
    }
  }
function activateAssociativeDomains ( xcodeProject , entitlementsFile ) { const configurations = removeComments ( xcodeProject . pbxXCBuildConfigurationSection ( ) ) ; let config ; let buildSettings ; for ( config in configurations ) { buildSettings = configurations [ config ] . buildSettings ; buildSettings . CODE_SIGN_IDENTITY = ` ${ CODESIGNIDENTITY } ` ; buildSettings . CODE_SIGN_ENTITLEMENTS = ` ${ entitlementsFile } ` ; // if deployment target is less then the required one - increase it if ( buildSettings . IPHONEOS_DEPLOYMENT_TARGET ) { const buildDeploymentTarget = buildSettings . IPHONEOS_DEPLOYMENT_TARGET . toString ( ) ; if ( compare ( buildDeploymentTarget , IOS_DEPLOYMENT_TARGET ) === - 1 ) { buildSettings . IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET ; } } else { buildSettings . IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET ; } } }
adds entitlement files to the xcode project
adds entitlement files to the xcode project