1

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Lopuch
  • 664
  • 2
  • 5
  • 20
  • I'm confused, is this a `href` you write in your Android app ? If so, where ? – Arthur Attout Nov 08 '19 at 13:25
  • I use Ionic, so this is a normal href in HTML page. Maybe Deep-linking is not a way how to do my request. But I cannot find another solution for creating a referral link that can be send by selected application. – Lopuch Nov 08 '19 at 13:30
  • 1
    In fact, the term 'deep linking' is wrong here. A deep link is an URI that directly refers to a specific app unambiguously. When you create a deep link for your app, you are ensured that any user that encounter this link will be redirected to your app. However, what you want is what is called a **chooser** (at least in Android), and that's completely different. Since Ionic is cross-platform, I'm not sure this applies to iOS and Windows phone aswell. – Arthur Attout Nov 08 '19 at 13:39
  • Many thanks. I will learn the topic. – Lopuch Nov 08 '19 at 13:47

1 Answers1

1

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);
      });
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Lopuch
  • 664
  • 2
  • 5
  • 20