hooks/lib/ios/xcodePreferences.js
function addPbxReference(xcodeProject) {
  var fileReferenceSection = nonComments(xcodeProject.pbxFileReferenceSection());
  var entitlementsFileName = path.basename(pathToEntitlementsFile());

  if (isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFileName)) {
    console.log('Entitlements file is in reference section.');
    return;
  }

  console.log('Entitlements file is not in references section, adding it');
  xcodeProject.addResourceFile(entitlementsFileName);
}
function addPbxReference(xcodeProject) {
  var fileReferenceSection = nonComments(xcodeProject.pbxFileReferenceSection());
  var entitlementsFileName = path.basename(pathToEntitlementsFile());

  if (isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFileName)) {
    console.log('Entitlements file is in reference section.');
    return;
  }

  console.log('Entitlements file is not in references section, adding it');
  xcodeProject.addResourceFile(entitlementsFileName);
}
function addPbxReference ( xcodeProject ) { var fileReferenceSection = nonComments ( xcodeProject . pbxFileReferenceSection ( ) ) ; var entitlementsFileName = path . basename ( pathToEntitlementsFile ( ) ) ; if ( isPbxReferenceAlreadySet ( fileReferenceSection , entitlementsFileName ) ) { console . log ( 'Entitlements file is in reference section.' ) ; return ; } console . log ( 'Entitlements file is not in references section, adding it' ) ; xcodeProject . addResourceFile ( entitlementsFileName ) ; }
region PBXReference methods 
Add .entitlemets file into the project.

@param {Object} xcodeProject - xcode project preferences; all changes are made in that instance
region PBXReference methods Add . entitlemets file into the project .