简体   繁体   English

应用索引-如何不将我的所有网站都映射到该应用

[英]app indexing - how not to map all my website to the app

I've been implementing google app indexing in my app, though it's turning out to be very hard for me to understand. 我一直在我的应用程序中实现google app索引编制,尽管事实证明我很难理解。 I've created the following intent-filter in my app 我已经在我的应用中创建了以下意图过滤器

        <intent-filter android:label="@string/app_name">
            <data android:scheme="android-app"
                android:host="com.towers.mywebsite" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http"
                android:host="www.mywebsite.com" />
            <data android:scheme="https"
                android:host="www.mywebsite.com" />
        </intent-filter>

I'd like to grab all the links like www.mywebsite.com?parameter=123 but NOT links like www.mywebsite.com/somethingelse 我想获取所有像www.mywebsite.com?parameter=123之类的链接,但不希望像www.mywebsite.com/somethingelse之类的链接

With the intent-filter above, my app is in the list of possible apps to open all the deep links like www.mywebsite.com... 使用上面的Intent过滤器,我的应用程序位于可能打开所有应用程序的深层链接的列表中,例如www.mywebsite.com ...

My question is: am I doing it right? 我的问题是:我做对了吗? How am I supposed to filter the intent in order not to make all the links try and open tre app? 为了不让所有链接尝试打开tre app,我应该如何过滤意图? I thought google would have chosen open-the-app-or-the-browser by checking which pages of my website do have the link rel attribute, but it seems like it only relies on my app intent-filter. 我以为Google会通过检查我网站的哪些页面确实具有link rel属性来选择“打开应用程序或浏览器”,但似乎它仅依赖于我的应用程序意图过滤器。 Therefore, I need to tweak them in order to filter only the pages I want. 因此,我需要对其进行调整,以便仅过滤所需的页面。 How can I do that? 我怎样才能做到这一点?

Thank you 谢谢

You can rely on markups if you don't declare App-Website association. 如果不声明App-Website关联,则可以依靠标记。 https://developers.google.com/app-indexing/android/app#declare-a-website-association https://developers.google.com/app-indexing/android/app#declare-a-website-association

You can also try controlling indexing by creating noindex.xml file to specify the URLs you want excluded from the Google index. 您也可以尝试通过创建noindex.xml文件来指定要从Google索引中排除的URL,从而控制索引编制。 https://developers.google.com/app-indexing/android/app#noIndex https://developers.google.com/app-indexing/android/app#noIndex

Cheers, 干杯,

MB 兆字节

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

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