如何通过短信发送的链接打开应用程序



我有一个React原生Android应用程序,我想通过短信发送的链接(深度链接(打开它。

我在网上进行了研究,并在AndroidManifest文件中添加了以下内容-(应用程序/活动(。

<intent-filter android:label="filter_react_native">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xxxxnativeapp" android:host="createpassword" /> 
</intent-filter>

有什么方法可以通过从一个手机向另一个手机发送带有链接的短信来测试这一点吗。如果是,我如何创建可以作为SMS发送的链接xxxxnativeapp://createpassword只是为了测试。应该打开应用程序。

为了测试,我尝试创建一个Native android应用程序,在文本视图中有一个href,它打开一个URL,但不打开应用程序。我认为从另一个应用程序打开应用程序与从链接打开应用程序。如果我错了就纠正我。

我也尝试过通过gmail发送xxxxnativeapp://createpassword,但我没有成功,因为如果我以这种方式发送,gmail会删除链接。

抱歉,我是个新手,所以想知道是否有人试图从作为短信发送的链接打开应用程序。

请建议我如何测试这个。

谢谢R

唯一的方法是使链接看起来像URL,这很容易做到。只需将方案更改为http

<data android:scheme="http"
android:host="xxxxnativeapp"
android:pathPrefix="/createpassword" />

现在你可以使用http://xxxxnativeapp/createpassword作为可点击链接

毫无价值,这在iOS 上是不可能的

相关内容

最新更新