从短信/电子邮件中的链接打开应用程序 [英] opening application from the sms/email link

查看:181
本文介绍了从短信/电子邮件中的链接打开应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们假设,如果我从我的手机发送的任何消息(推荐),以一个朋友的电话谁点击链接安装的应用程序(这是我朋友的设备上运行)。

Let us suppose if I send any message (recommendation) from my mobile to a friends phone who clicks on the link to install application(which is run on my friend's device).

我无法得到正确的思路来做到这一点。

I couldn't get the right ideas to do that.

任何人可以帮助我吗?

推荐答案

您可以创建自定义方案(即一种特殊类型的链接的)。如果通过就可以了短信和用户点击发送这样的链接,然后注册应用程序将被启动。

You can create a custom scheme (i.e. a special type of 'link'). If you send such a link via SMS and user clicks on it, then a registered app will be started.

编辑,以提供例如:

<intent-filter>
    <action android:name="android.intent.action.VIEW"/> 
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:scheme="http" android:host="com.yourhostname"/>
</intent-filter>

如果您更改 com.yourhostname 为您的网站的主机名。所以,你发送短信某些URL包含该主机名,例如http://www.yourhostname.com/some-generated-path',那么如果用户您的应用程序安装了这个链接将被应用程序打开,但如果不是那么链接将在浏览器中打开还是给你机会展示内容给该用户。

Where you change com.yourhostname for your site hostname. So of you send some url in SMS that contains this hostname, e.g. 'http://www.yourhostname.com/some-generated-path', then if user has you app installed this link will be opened by the app, but if not then link will be opened in browser still giving you opportunity to show the content to this user.

这篇关于从短信/电子邮件中的链接打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆