简体   繁体   English

Android无法通过客户Sheme从URL打开natvie应用

[英]Android Can not open natvie app from url by customer sheme

i have a ProductDeatailActivity in my android app,now i want to give my users a url,then they can open ProductDeatailActivity by clicking on this link and pass parameters to the activity,but when i entered this link, i can not open my app in the browser,this is my url xgshuo://xgshuo.app/product_detail?product_id=2343535454 i have added the intent_filter 我在我的Android应用程序中有一个ProductDeatailActivity,现在我想给我的用户一个URL,然后他们可以通过单击此链接并向活动传递参数来打开ProductDeatailActivity,但是当我输入此链接时,我无法在浏览器,这是我的网址xgshuo://xgshuo.app/product_detail?product_id = 2343535454我已经添加了intent_filter

<activity android:name=".ui.activity.ProductDetailActivity"
            android:screenOrientation="portrait"
            >
            <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:scheme="xgshuo" android:host="xgshuo.app" android:pathPrefix="/product_detail"/>
            </intent-filter>
        </activity>

you might be looking for this thing http://insidesearch.blogspot.in/2015/11/new-ways-to-find-and-stream-app-content.html 您可能正在寻找这个东西http://insidesearch.blogspot.in/2015/11/new-ways-to-find-and-stream-app-content.html

But still its in beta mode so dont try it, it will not work untill google rollout it thought out world. 但是它仍然处于测试版模式,因此请不要尝试,直到谷歌推出它的世界,它才起作用。

read this carefully in blog. 请在博客中仔细阅读。

We're exploring both of these new ways to show you great “app-first” content from a small group of partners, such as HotelTonight, Chimani, Daily Horoscope or New York MTA Subway Map — stay tuned for more as we expand this! 我们正在探索这两种新方法,以向少数合作伙伴(例如HotelTonight,Chimani,Daily Horoscope或New York MTA Subway Map)的合作伙伴展示出色的“应用程序优先”内容-敬请期待,我们会不断扩展!

After setting your schema (As shown in your question) to verify your deeplinking code you need to create sample html file using below code and open it in your mobile browser and hit the link if your application is open then you done right from your side otherwise Issue with browser compatibility. 设置架构(如您的问题所示)以验证您的深层链接代码后,您需要使用以下代码创建示例html文件,然后在移动浏览器中打开该文件,然后点击链接(如果您的应用程序处于打开状态),然后直接从旁边进行操作浏览器兼容性问题。

You can see the reference link : https://developers.google.com/app-indexing/android/test 您可以看到参考链接: https : //developers.google.com/app-indexing/android/test

Here is your test.html 这是您的test.html

<html>
<body>
  <a alt="intent:///product_id=2343535454#Intent;scheme=xgshuo://xgshuo.app/product_detail;package=your_package_name_here;end" href="xgshuo://xgshuo.app/product_detail?product_id=2343535454">android-app://your_package_name_here/xgshuo://xgshuo.app/product_detail?product_id=2343535454</a>
</body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM