【问题标题】:redirect to app from custom tabs从自定义选项卡重定向到应用程序
【发布时间】:2018-01-05 11:42:02
【问题描述】:

我正在用 react native 创建 android 应用程序。我的应用程序在本地系统上,而不是在实时服务器上上传。我使用 CustomTabs 打开外部 url 。我想从外部 url 重定向回应用程序。我对 AndroidManifest.xml 进行了更改:-

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

并将其添加到我的外部网址中:

<a href="intent://mywebsite.com/index#Intent;package=com.myapp;scheme=http;end;"/>click</a>

当我点击它的重定向到播放商店时。我希望它重定向到我的应用程序,即在我的本地系统上。我如何添加网址,因为应用程序在本地系统上。有什么办法吗??

【问题讨论】:

    标签: android deep-linking


    【解决方案1】:

    您需要在意图过滤器中添加这些参数:

    <data android:pathPattern="/Android" />
    

    这意味着您可以使用以下方式指导用户:

    window.location = "/Android";
    

    这应该适合你,检查这个link

    【讨论】:

    • 我用过这个,实际上我使用的外部网址是现场网址。如果我使用过 window.location = "/Android";比它重定向到我example.com/Android
    • 我的应用在我的本地系统上,外部网址是实时网站。
    猜你喜欢
    • 2017-05-22
    • 2011-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多