Var*_*ani 37 android firebase firebase-app-indexing
我想实现火力地堡应用编入索引,而更新的任务可转位是显示成功,该指数也显示在了在应用程序在谷歌应用程序搜索后标签.根据我的理解,在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);
}
});
Run Code Online (Sandbox Code Playgroud)
我正在使用的Firebase App Indexing库的版本也是
compile 'com.google.firebase:firebase-appindexing:10.0.1'
Run Code Online (Sandbox Code Playgroud)
有什么我想念的吗?我正在测试运行Stock 7.1.1和Google App版本的Nexus 6P 6.9.36.21.arm64.
Indexables需要使用Indexable.Builder构建每个项目(这暗示了循环)...而 DigitalDocumentBuilder是它的一个相当具体的实现,特别是对于数字文档。
Indexable recipe = new Indexable.Builder()
.setName("Brownie Recipe")
.setUrl("//acme.com/recipes/12345678")
.build();
FirebaseAppIndex.getInstance().update(recipe);
Run Code Online (Sandbox Code Playgroud)
查看AppIndex文档或
构建并运行 AppIndexing快速入门:
git clone https://github.com/firebase/quickstart-android.git。
进一步阅读:为应用程序内容启用深层链接。
该教程(和问题)似乎有点过时;当前版本是11.0.2.
另外com.google.android.gms:play-services-appindexing是必需的。
| 归档时间: |
|
| 查看次数: |
1685 次 |
| 最近记录: |