【问题标题】:Has anyone got Firebase app indexing to work?有没有人让 Firebase 应用索引工作?
【发布时间】:2016-08-02 15:36:09
【问题描述】:

implementation 之后,我能够通过 Android Studio 测试(工具 > Android > Google App Indexing Test)成功确认 Google Bot 可以索引我的应用程序。根据 Google Search Console,我的应用程序的 200 多个页面已被编入索引。但是这里有问题

  • Google 抓取总是失败
  • Firebase 应用程序indexing test 失败。

如果已安装该应用,则点击 Google 搜索结果将打开该应用。但如果该应用未安装,则会转到网站(即搜索结果中没有安装按钮)。

Firebase 的所有其他功能都有效:应用邀请、深度链接、分析。

所以我想问,有没有人真正让 Firebase App Indexing 工作?如果是这样,那么真的吗?

我的应用是一个带有 Spinner 的 Activity,用户可以通过从 Spinner 中选择一个项目来选择内容。当用户做出选择时,会填充一个片段。当然,为了索引,当 Fragment 被填充时我调用AppIndex.AppIndexApi.start(client, getAction()),当用户选择不同的内容时我调用AppIndex.AppIndexApi.end(client, getAction())……并重复 start-end。

除了使用Digital Asset Links,我还通过Search Console 将我的应用程序与我的网站关联起来。

【问题讨论】:

    标签: android firebase android-app-indexing firebase-app-indexing


    【解决方案1】:

    几件事:

    Fetch as Google 总是失败。 Firebase 应用索引测试失败。

    您可能需要检查您网站的 robots.txt,以阻止 Google 漫游器抓取您的 API。

    如果已安装该应用,则点击 Google 搜索结果将打开该应用。但如果该应用未安装,则会转到网站(即搜索结果中没有安装按钮)。

    要实现如下截图所示的应用安装流程,您实际上需要在您的网站上实现Web App Manifest


    (来源:google.com

    【讨论】:

      【解决方案2】:

      我已经在我的项目中实现了应用程序索引。前几天它没有显示任何安装按钮。尝试将您的网站链接作为属性包含在搜索控制台中,并将应用程序包名称作为属性添加到 search console

      https://productforums.google.com/forum/#!topic/webmasters/Mqo_GOJO2pE类似问题的链接。

      【讨论】:

        【解决方案3】:

        需要的包和类

        import com.google.firebase.appindexing.Action;
        import com.google.firebase.appindexing.FirebaseUserActions;
        import com.google.firebase.appindexing.FirebaseAppIndex;
        import com.google.firebase.appindexing.Indexable;
        import com.google.firebase.appindexing.builders.Actions;
        
        String TITLE = "your screen title";
        static Uri BASE_URL = "your site uri";
        String webPath = "application route";
        String APP_URI =  BASE_URL.buildUpon().appendPath(webPath).build().toString();
        Indexable indexPage = new Indexable.Builder().setName(TITLE).setUrl(APP_URI).build();
        FirebaseAppIndex.getInstance().update(indexPage);
        FirebaseUserActions.getInstance().start(Actions.newView(TITLE, APP_URI)); // call on opening the view
        FirebaseUserActions.getInstance().end(Actions.newView(TITLE, APP_URI)); // call on closing the view
        

        现在您的应用屏幕将被编入索引并通过网址打开 在 web 应用程序/html 页面中添加以下行

        <meta property="al:android:url" content="" />
        <meta property="al:android:app_name" content="" />
        <meta property="al:android:package" content="" />
        <meta property="al:web:url" content="" />
        <link rel="alternate" href="" />
        

        【讨论】:

        • 如果我们实现 "" 这个手动到网站,有什么问题吗?
        • 不会有任何问题。它不会打开应用程序。因为您的网站与 Instagram 应用没有关联。如果应用程序必须处理来自网站的链接,则必须在 AndroidManifest.xml 中提及这些网站地址。
        • 嗨@pavel你使用的是cordova还是原生android
        • 此文件包含应用索引的代码,您可以使用它删除cordova依赖github.com/learnyst/cordova-plugin-firebase-appindexing/blob/…
        • 原生安卓@user5811898
        猜你喜欢
        • 1970-01-01
        • 2011-10-02
        • 1970-01-01
        • 2010-09-14
        • 1970-01-01
        • 2019-04-08
        • 1970-01-01
        • 1970-01-01
        • 2023-03-30
        相关资源
        最近更新 更多