Lopuch
Lopuch

Reputation: 784

Create deep link for multiple applications

I need to create deep link consumable by multiple applications.

This works in Duolingo: referral link In Duolingo you can send referral link by SMS, Email, copy to clipboard etc..

This link works fine for opening a Play Store

<a href="market://details?id=my.app.com" target="_top">App</a>

My idea is to make link like this:

<a href="text://value?Please clink on this referral link https://superapp.com?referral=abc123" target="_top">App</a>

Users than select by which application they will send the message (SMS, Gmail..)

How to accomplish this task to work exactly the same as Duolingo referrals?

For example: how to create a deep link that fills the body of an email in Gmail app?

Upvotes: 1

Views: 615

Answers (1)

Lopuch
Lopuch

Reputation: 784

I found a solution for ionic!

The topic is called Intent

Install this cordova plugin https://ionicframework.com/docs/native/web-intent/

In code call this:

const options: IntentOptions = {
      action: this.webIntent.ACTION_SEND,

      type: 'text/plain',
      extras: {
        'android.intent.extra.TEXT': 'Hello, click on this referral link: https://duckduckgo.com and support me!'
      }
    }

    this.webIntent.startActivity(options).
    then(
      (x) => {
        console.log("success.x:", x);
      },
      (x) => {
        console.log("error.x: ", x);
      });

Upvotes: 1

Related Questions