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.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

3 Answers3

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)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
dlackty
  • 1,861
  • 14
  • 17
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.

shalini
  • 355
  • 4
  • 17
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="" />
OK200
  • 727
  • 6
  • 22
  • what if we implement "" this to the site manuelly,does it cause any problem? – bilaldogan Jul 07 '17 at 14:27
  • 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. – OK200 Jul 11 '17 at 10:18
  • Hi @pavel are you using cordova or native android – OK200 Sep 23 '17 at 07:35
  • This file has code to app indexing you can use it removing the cordova dependency https://github.com/learnyst/cordova-plugin-firebase-appindexing/blob/master/src/android/AppIndexing.java – OK200 Sep 23 '17 at 11:51
  • native android @user5811898 – pavel Sep 23 '17 at 17:18
  • https://github.com/firebase/quickstart-android/tree/master/app-indexing – OK200 Sep 24 '17 at 16:01