Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
310 views
in Technique[技术] by (71.8m points)

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. 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

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.

question from:https://stackoverflow.com/questions/41649828/android-firebase-app-indexing-app-not-showing-in-google-autocomplete-suggestio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

also com.google.android.gms:play-services-appindexing is required.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...