Open external app with uri scheme using Deeplinks

Hello there,

I have two apps the first and the second. I want to run second app via deeplink with some params from the first app.
Ionic 3.19, cordova 8.0.0, android application. Unfortunately app is not opening when I am using link shown in example.

Example:

openApp() {
       window.open("secondApp://myserver.com/?param1=111&param2=222", "_system");
}

And external app deeplinking config:

in home.ts (or app.component.ts, no difference):

  platform.ready().then(
        () => {
          this.deeplinks.route({
            '/': {}
          }).subscribe((match) => {
      
      
            let alert = this.alertCtrl.create();
            alert.setTitle('App opened from deeplink!');
            alert.setMessage(match.$args.param1+ " : " + match.$args.param2);
            alert.addButton('Ok');
            alert.present();
      
            this.receivedData = {
              param1: match.$args.param1,
              param2: match.$args.param2
            }
      
          }, (nomatch) => {
            this.receivedData = {
              param1: 'no data',
              param2: 'noData'
            };
            console.error('Got a deeplink that didn\'t match', nomatch);
          });
      
        });

package.json

    "plugins": {
      "ionic-plugin-deeplinks": {
        "URL_SCHEME": "secondApp",
        "DEEPLINK_SCHEME": "https",
        "DEEPLINK_HOST": "myserver.com",
        "ANDROID_PATH_PREFIX": "/"
      }

config.xml:

 <plugin name="ionic-plugin-deeplinks" spec="1.0.0">
        <variable name="URL_SCHEME" value="secondApp" />
        <variable name="DEEPLINK_SCHEME" value="https" />
        <variable name="DEEPLINK_HOST" value="myserver.com" />
        <variable name="ANDROID_PATH_PREFIX" value="/" />
    </plugin>

Could it be problem with ionic version, or I’ve made some errror? I’ve tried tons of combinations with it :confused:

Thanks for response.

try this plugin for opening the link https://ionicframework.com/docs/native/in-app-browser/

Unfortunately this plugin is adding “http” before “secondApp” uri scheme and opens this link in the browser, not the actual app

Hi @Paat , I’m trying to do the same as you. Opening an external app who’s mine.

I’ve tried deeplink and startapp but nothing is working.

Did you found any solutions or workaround ?

2 Likes

Same problem here, i can’t found a solution

Any workaround to solve?

Still you haven’t found any solution ? I have two apps and open one app from another.

Hello! Yes, there is a Solution you need to change *-info.plist adding this (I do on xCode, but i think you can change in the code): Add a new row on .plist, next you need to write “URL Types”, add new row again, write or find URL Schemes, add new row, and to finish up you need to write the identifier of the apps you need to open.

If you don’t understand something, tell me pls.