Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Open external app with uri scheme using Deeplinks

$
0
0

@Paat wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles