简体   繁体   English

Android - Firebase App Indexing App未显示在Google自动填充建议中

[英]Android - Firebase App Indexing App not showing in google autocomplete suggestions

I am trying to implement Firebase App Indexing, while the task to update the indexable is showing success and the index is also shown in the In Apps tab after searching in Google App. 我想实现火力地堡应用编入索引,而更新的可转位的任务,显示成功,并在谷歌应用程序搜索后的指数也显示在了在应用程序选项卡。 From what I understand, the index should also show up in the Auto Complete Suggestions when searching in the Google App but its not shown. 根据我的理解,在Google App中搜索时,索引也应显示在自动完成建议中但未显示。 I am following the tutorial from here . 我从这里开始关注教程。 Following is the code snippet I am using to index the content: 以下是我用来索引内容的代码片段:

Indexable menuItemToIndex = Indexables.noteDigitalDocumentBuilder()
                            .setName(title)
                            .setText(text)
                            .setUrl(link)
                            .build();

Task<Void> task = FirebaseAppIndex.getInstance().update(menuItemToIndex);

task.addOnCompleteListener(new OnCompleteListener<Void>() {
    @Override
    public void onComplete(@NonNull Task<Void> task) {
        Log.d(TAG, "App index updated: " + title);
    }
});

Also the version of the Firebase App Indexing library I'm using is 我正在使用的Firebase App Indexing库的版本也是

compile 'com.google.firebase:firebase-appindexing:10.0.1'

Is there anything I'm missing? 有什么我想念的吗? I am testing on Nexus 6P running on Stock 7.1.1 and Google App version 6.9.36.21.arm64 . 我正在测试运行在Stock 7.1.1和Google App版本6.9.36.21.arm64上的Nexus 6P。

Indexables need to be built with the Indexable.Builder , per item (which hints for a loop) ...while the DigitalDocumentBuilder is a rather specific implementation of it, especially for digital documents. Indexables需要使用Indexable.Builder构建,每个项目(提示循环)......而DigitalDocumentBuilder是一个相当具体的实现,特别是对于数字文档。

Indexable recipe = new Indexable.Builder()
    .setName("Brownie Recipe")
    .setUrl("//acme.com/recipes/12345678")
    .build();

FirebaseAppIndex.getInstance().update(recipe);

the tutorial (and the question) appears a little dated; 教程(和问题)似乎有点过时了; the current version is 11.0.2 . 当前版本是11.0.2

also com.google.android.gms : play-services-appindexing is required. 另外还有com.google.android.gmsplay-services-appindexing

在更新了您已完成的项目之后,您还需要使用与更新项目相同的URL创建相应的视图操作,就像在配方应用程序中一样,然后它将自动完成。

FirebaseUserActions.getInstance().start(Actions.newView(item.getTitle(),"http://example.com/item?id=5"))

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

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