繁体   English   中英

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

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

我想实现火力地堡应用编入索引,而更新的可转位的任务,显示成功,并在谷歌应用程序搜索后的指数也显示在了在应用程序选项卡。 根据我的理解,在Google App中搜索时,索引也应显示在自动完成建议中但未显示。 我从这里开始关注教程。 以下是我用来索引内容的代码片段:

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);
    }
});

我正在使用的Firebase App Indexing库的版本也是

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

有什么我想念的吗? 我正在测试运行在Stock 7.1.1和Google App版本6.9.36.21.arm64上的Nexus 6P。

Indexables需要使用Indexable.Builder构建,每个项目(提示循环)......而DigitalDocumentBuilder是一个相当具体的实现,特别是对于数字文档。

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

FirebaseAppIndex.getInstance().update(recipe);

教程(和问题)似乎有点过时了; 当前版本是11.0.2

另外还有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