ionic-team / ionic-plugin-deeplinks

Handle deeplinks into your Ionic/Cordova apps from Universal Links, App Links, and Custom URL schemes. For those using Ionic 2, there are some nice goodies that make life easier.
Other
332 stars 218 forks source link

Support multiple domains iOS #120

Open horodnicdragos opened 7 years ago

horodnicdragos commented 7 years ago

Greetings!

I have seen that there is a multiple domain feature implemented already for android. However, even though I have domain1 in DEEPLINK_HOST and domain2 in DEEPLINK_HOST_2, the AASA on both domains, and the associated domains set up in my xcode project, deeplinking will only work on domain1. I have moved domain1 in DEEPLINK_HOST_2, and domain2 in DEEPLINK_HOST and deeplinking will only work on domain2. Is there a workaround to have the app working on multiple domains?

schinnaraju commented 6 years ago

have the source changed in your installed plugin before generating build.

  1. Change in configXmlParser.js -> getDeeplinkHostFromDeeplinksConfig() to be rewritten as
    function getDeeplinkHostFromDeeplinksConfig(xmlDeeplinksPlugin) {
    var xmlDeeplinksPluginVariables = xmlDeeplinksPlugin['variable'];
    var deeplinkHost = [];
    xmlDeeplinksPluginVariables && xmlDeeplinksPluginVariables.forEach(function(xmlElement) {
    var elementsName = xmlElement.$.name;
    if (elementsName.indexOf('_HOST') !== -1 && xmlElement.$.value.trim() !== '') {
      deeplinkHost.push(xmlElement.$.value);
    }
    });
    return deeplinkHost;
    }
  2. Change in projectEntitlements.js -> generateAssociatedDomainsContent() to be rewritten as
    function generateAssociatedDomainsContent(deeplinkHost) {
    var domainsList = [];
    deeplinkHost.forEach(host => {
    if (host.trim() !== '') {
      domainsList.push(domainsListEntryForHost(host));
    }
    });
    return domainsList;
    }

    Note: You can modify these files and have this copied into your local(config) and run a command to copy this local file into the generated plugin before generating build.

akshukla07 commented 3 years ago

Does the plugin now support multiple domains for iOS in Ionic 3?