为多个应用创建深度 link
Create deep link for multiple applications
我需要创建供多个应用程序使用的深层 link。
这在 Duolingo 中有效:
在 Duolingo 中,您可以通过短信、电子邮件、复制到剪贴板等方式发送推荐 link。
这个 link 可以很好地打开 Play 商店
<a href="market://details?id=my.app.com" target="_top">App</a>
我的想法是link这样:
<a href="text://value?Please clink on this referral link https://superapp.com?referral=abc123" target="_top">App</a>
用户比 select 他们将通过哪个应用程序发送消息(SMS、Gmail..)
如何完成与 Duolingo 推荐完全相同的任务?
例如:如何在 Gmail 应用程序中创建填充电子邮件正文的深度 link?
我找到了 ionic 的解决方案!
题目叫做意图
安装这个 cordova 插件 https://ionicframework.com/docs/native/web-intent/
在代码中这样调用:
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);
});
我需要创建供多个应用程序使用的深层 link。
这在 Duolingo 中有效:
这个 link 可以很好地打开 Play 商店
<a href="market://details?id=my.app.com" target="_top">App</a>
我的想法是link这样:
<a href="text://value?Please clink on this referral link https://superapp.com?referral=abc123" target="_top">App</a>
用户比 select 他们将通过哪个应用程序发送消息(SMS、Gmail..)
如何完成与 Duolingo 推荐完全相同的任务?
例如:如何在 Gmail 应用程序中创建填充电子邮件正文的深度 link?
我找到了 ionic 的解决方案!
题目叫做意图
安装这个 cordova 插件 https://ionicframework.com/docs/native/web-intent/
在代码中这样调用:
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);
});