Android - Firebase App Indexing App not showing in google autocomplete suggestions
Asked Answered
A

2

38

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.

Ardine answered 14/1, 2017 at 12:9 Comment(5)
I have exactly the same problem. I have followed the tutorial step by step and the suggestions do not appear. I have checked the Firebase App Indexing DB within the Google developer tools and my items are there, but for some reason the Google app does not show them.Katiakatie
Can you check the intent handler for the URL is set up properly in your app? What scheme are you using for the links?Airfield
make sure the deep links are in proper format. The URI format for deep link is - android-app://<package_name>/<scheme>/<host_path>.Liquate
Did you find a solution?Nika
I also run into this problem. First be absolutely sure you see the firebase logging (see codelabs.developers.google.com/codelabs/app-indexing/#12) If you see that then check if you have enough disk space available for indexing. Wasn't showing up in the logs at all in my case. just like you results in the google app. I tried it on a different phone and it worked instantly.Goneness
R
3

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.

Rale answered 25/7, 2017 at 15:18 Comment(2)
appears a little dated. Good joke. What's the point of touching rusted questions? 3 years is hell lot of time in ITBurkes
well, it was on top of the stack and not yet answered - and so I've explained it. have no clue by which parameters these are being sorted, often seen questions which received "too little attention". and with 31 up-votes and 4 users following it, it still makes sense.Rale
M
2

After updating items like you have done, you also need to create a corresponding view action with the same url you used to update the item, just like in the recipe app, before it will appear in auto complete.

FirebaseUserActions.getInstance().start(Actions.newView(item.getTitle(),"http://example.com/item?id=5"))
Merimerida answered 19/1, 2018 at 1:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.