1

I am trying to use Firebase App indexing to index custom user content. I do something like this:

Indexable indexable = new Indexable.Builder()
      .setUrl("custom_scheme://domain/path")
      .setName(title)
      .setDescription(description)
      .build();
FirebaseAppIndex.getInstance().update(indexable)

But if I track update task using listener I receive add to index error. Just one change custom scheme to http/https scheme for URI makes it work. It is ok for me in this app. But, what if I just want to index my app private content without some correct html url, because for example I don't have web site. Is it possible to use custom scheme for Firebase App Indexing just in Google App?

busylee
  • 2,540
  • 1
  • 16
  • 35

1 Answers1

0

I doubt this is possible. App Indexing essentially binds your corresponding website URLs to your app. Such that your website is crawled and indexed by Google and can appear in search results. If you want to keep your content private and only available on the device's index you can add the following property to your Indexable object:

Indexable indexable = new Indexable.Builder()
  .setUrl("custom_scheme://domain/path")
  .setName(title)
  .setDescription(description)
  .setMetadata(new Action.Metadata.Builder().setUpload(false))
  .build();
FirebaseAppIndex.getInstance().update(indexable)

For more information you can check out: https://firebase.google.com/docs/app-indexing/

mtraverso
  • 159
  • 2
  • 8
  • From [https://firebase.google.com/docs/app-indexing/android/app](https://firebase.google.com/docs/app-indexing/android/app): Using custom scheme URLs? Custom scheme URLs continue to be supported, although they are not recommended. You can declare them as rel=alternate elements either in the head of the HTML page or in the sitemap. [Associate your site and app in Search Console](https://support.google.com/webmasters/answer/6212023) so Google can crawl your sitemap for App Indexing. So I'd amend my answer "It is possible, but is discouraged from using custom schemes." – mtraverso Mar 22 '17 at 22:05