4

So, I was trying to implement app indexing to allow "Open in App" feature from google search (in Chrome app).

I've implemented the following sections from google docs https://developers.google.com/app-indexing/:

  1. Add Deep Linking to your App

    <activity
        android:name=".DeepLinkActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:scheme="http"
                android:host="dl.mysite.com"
                android:pathPattern="/" /> <!-- Home page -->
        </intent-filter>
    </activity>
    
  2. Connect your App

    I've verified and approved the website from Webmaster and Play console.

  3. Provide Deep Links

    <link rel="alternate" href="android-app://com.MyApp.MyApp/http/dl.mysite.com/" />
    

I've tried testing my link "android-app://com.MyApp.MyApp/http/dl.mysite.com/" in https://developers.google.com/app-indexing/webmasters/test and the link opens my app home page. However, the listing corresponding to my site in google search results (in Chrome app) has no "Open in App" function.

I'd like to have this "Open in App" function. I'd appreciate any help.

miketreacy
  • 1,120
  • 1
  • 11
  • 17
ArunL
  • 350
  • 2
  • 14
  • Are you getting any errors for app indexing in Webmaster Tools? – moobot May 04 '15 at 09:40
  • 1
    I had the build in beta. I just moved it to production in play console and it worked! – ArunL May 04 '15 at 18:24
  • What do u mean with "I had the build in beta"? I have currently the same problem and i can't find a solution. http://stackoverflow.com/questions/32948746/app-indexing-android-link-in-head-doesnt-work Maybe u can help? – iFoukis Oct 05 '15 at 12:45
  • 1
    The build was set up for **BETA TESTING** in **Google Play Developer Console**. App Indexing worked once I moved the apk to **PRODUCTION**. – ArunL Oct 06 '15 at 07:50

3 Answers3

2

Try this solution

<activity ... android:launchMode="singleTask">
[...]
<intent-filter>
   <action android:name="android.intent.action.VIEW" />
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE" />
                <data
                    android:host="@string/domain"
                    android:scheme="https"
                    android:pathPattern=".*" />
                <data
                    android:host="@string/domain"
                    android:scheme="http"
                    android:pathPattern=".*" />
</intent-filter>

Different behaviors in Open in App from browsers and other applications to my webView app

skatehype
  • 73
  • 1
  • 11
1

android-app://... is a normal deep link and is different from App Indexing.

App Indexing include http://... and https://... urls only!

If you want App Indexing to work, What you need is a /.well-known/assetlinks.json as on website.

It's called Google/ Firebase App Indexing - https://firebase.google.com/docs/app-indexing

There is an App Links Assistant built into Android Studio that will help you generate the assetlinks.json file and test URLs among other useful things.

ericn
  • 12,476
  • 16
  • 84
  • 127
0

Answer to a similar question addresses this problem.

App Indexing Android - "<link>" in "<head>" doesn't work

To quote, "It'll work only from google search results page. If your website is properly indexed and appears in google search results, check if exists in the website's page source in google's cached content: http://webcache.googleusercontent.com/search?q=cache:yourwebsite.com.

Also, you might need to move your apk to PRODUCTION if it's in BETA TESTING in Google Play Developer Console."

Community
  • 1
  • 1
ArunL
  • 350
  • 2
  • 14