examples/cordova1/plugins/branch-cordova-sdk/src/scripts/ios/updateAssociatedDomains.js
function updateAssociatedDomains(preferences) {
    const domainList = [];
    const prefix = "applinks:";
    const linkDomains = preferences.linkDomain;

    for (let i = 0; i < linkDomains.length; i++) {
      const linkDomain = linkDomains[i];

      // add link domain to associated domain
      domainList.push(prefix + linkDomain);

      // app.link link domains need -alternate associated domains as well (for Deep Views)
      if (linkDomain.indexOf("app.link") !== -1) {
        const first = linkDomain.split(".")[0];
        const second = linkDomain.split(".")[1];
        const rest = linkDomain
          .split(".")
          .slice(2)
          .join(".");
        const alternate = `${first}-alternate`;

        domainList.push(`${prefix + alternate}.${second}.${rest}`);
      }
    }

    return domainList;
  }
function updateAssociatedDomains(preferences) {
    const domainList = [];
    const prefix = "applinks:";
    const linkDomains = preferences.linkDomain;

    for (let i = 0; i < linkDomains.length; i++) {
      const linkDomain = linkDomains[i];

      // add link domain to associated domain
      domainList.push(prefix + linkDomain);

      // app.link link domains need -alternate associated domains as well (for Deep Views)
      if (linkDomain.indexOf("app.link") !== -1) {
        const first = linkDomain.split(".")[0];
        const second = linkDomain.split(".")[1];
        const rest = linkDomain
          .split(".")
          .slice(2)
          .join(".");
        const alternate = `${first}-alternate`;

        domainList.push(`${prefix + alternate}.${second}.${rest}`);
      }
    }

    return domainList;
  }
function updateAssociatedDomains ( preferences ) { const domainList = [ ] ; const prefix = "applinks:" ; const linkDomains = preferences . linkDomain ; for ( let i = 0 ; i < linkDomains . length ; i ++ ) { const linkDomain = linkDomains [ i ] ; // add link domain to associated domain domainList . push ( prefix + linkDomain ) ; // app.link link domains need -alternate associated domains as well (for Deep Views) if ( linkDomain . indexOf ( "app.link" ) !== - 1 ) { const first = linkDomain . split ( "." ) [ 0 ] ; const second = linkDomain . split ( "." ) [ 1 ] ; const rest = linkDomain . split ( "." ) . slice ( 2 ) . join ( "." ) ; const alternate = ` ${ first } ` ; domainList . push ( ` ${ prefix + alternate } ${ second } ${ rest } ` ) ; } } return domainList ; }
determine which Branch Link Domains to append
determine which Branch Link Domains to append