Has anyone got Firebase app indexing to work?
Asked Answered
G

3

33

After the implementation, I am able to successfully confirm that Google Bot can index my app through Android Studio testing (Tools > Android > Google App Indexing Test). And per Google Search Console, over 200 pages of my app have been indexed. But here follow the problems

If the app is installed, then clicking on a Google Search result will open the app. But if the app is not installed, it goes to the website (i.e. no install button in search results).

Everything else with Firebase works: app invite, deep linking, analytics.

So I am asking, has anyone out there actually gotten Firebase App Indexing to work? And if so, how REALLY?

My app is one Activity with a Spinner where users choose content by selecting an item from the spinner. And a Fragment is populated when the user makes a choice. And of course to index, I call AppIndex.AppIndexApi.start(client, getAction()) when the Fragment is populated and I call AppIndex.AppIndexApi.end(client, getAction()) when the user chooses a different content… and repeat start-end.

Also instead of using Digital Asset Links I am associating my app with my website through the Search Console.

Galarza answered 2/8, 2016 at 15:36 Comment(0)
P
2

Few things:

Fetch as Google always fails. Firebase app indexing test fails.

You might need to check robots.txt for your website to not prevent Google bots to crawl your APIs.

If the app is installed, then clicking on a Google Search result will open the app. But if the app is not installed, it goes to the website (i.e. no install button in search results).

To achieve the app installation flow shown in the following screenshot, you actually need to implement Web App Manifest on your site.


(source: google.com)

Packaging answered 7/4, 2017 at 14:1 Comment(0)
S
0

I have implemented App indexing in my project.First few days it was not showing any install button.Try including your website link as a Property in search console plus app package name as property in search console

https://productforums.google.com/forum/#!topic/webmasters/Mqo_GOJO2pE link for similar problem.

Salient answered 3/5, 2017 at 18:14 Comment(0)
P
0

Needed packages and classes

import com.google.firebase.appindexing.Action;
import com.google.firebase.appindexing.FirebaseUserActions;
import com.google.firebase.appindexing.FirebaseAppIndex;
import com.google.firebase.appindexing.Indexable;
import com.google.firebase.appindexing.builders.Actions;

String TITLE = "your screen title";
static Uri BASE_URL = "your site uri";
String webPath = "application route";
String APP_URI =  BASE_URL.buildUpon().appendPath(webPath).build().toString();
Indexable indexPage = new Indexable.Builder().setName(TITLE).setUrl(APP_URI).build();
FirebaseAppIndex.getInstance().update(indexPage);
FirebaseUserActions.getInstance().start(Actions.newView(TITLE, APP_URI)); // call on opening the view
FirebaseUserActions.getInstance().end(Actions.newView(TITLE, APP_URI)); // call on closing the view

now your app screens will be indexed and open through url's add the below lines in the web app/ html pages

<meta property="al:android:url" content="" />
<meta property="al:android:app_name" content="" />
<meta property="al:android:package" content="" />
<meta property="al:web:url" content="" />
<link rel="alternate" href="" />
Puree answered 30/6, 2017 at 14:17 Comment(6)
what if we implement "<link rel="alternate" href="android-app://com.instagram.android/https/instagram.com/_u/salihucan48/" />" this to the site manuelly,does it cause any problem?Monazite
It won't cause any problem. It won't open the app. Because your site is not associated with the instagram app. If the app have to handle links from website those websites address have to to mentioned in AndroidManifest.xml.Puree
Hi @pavel are you using cordova or native androidPuree
This file has code to app indexing you can use it removing the cordova dependency github.com/learnyst/cordova-plugin-firebase-appindexing/blob/…Puree
native android @user5811898Permissive
github.com/firebase/quickstart-android/tree/master/app-indexingPuree

© 2022 - 2024 — McMap. All rights reserved.