Open external app with uri scheme using Deeplinks


#1

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.


#2

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


#3

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


#4

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 ?