In-App-Indexing not working on Android 4?

251 views Asked by At

I've followed the documentation for In-App-Indexing by

  • uploading a assetlinks.json to https://mycompany.com/.well-known/assetlinks.json
  • adding com.google.firebase:firebase-appindexing:11.6.0 as a dependency and

  • adding to the Manifest of my app:

    <activity
        android:name=".main.view.MainScreenActivity"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:theme="@style/AppTheme.NoActionBar">
    
        <!--deeplinking-->
        <intent-filter
            android:autoVerify="true"
            android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />
    
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
    
            <data
                android:host="www.mycompany.com"
                android:path="/" />
    
            <data android:scheme="http" />
            <data android:scheme="https" />
    
            <data android:pathPattern="/somepath/" />
    
        </intent-filter>
    </activity>
    

I've tested all this according to the documentation and all seems fine.

On Android 5 and above, I can download my app from the Play Store, search for content of my site, and Google will show results directly from my app. I can also jump directly from Google's search results into my app. So all fine.

This doesn't work though on Android 4.

I've noticed that, when installing and opening my app on Android 5, the following will be displayed in the logs:

I/IntentFilterIntentSvc: Verifying IntentFilter. verificationId:4 scheme:"https" hosts:"www.mycompany.com" package:"com.mycompany.myapp". 12-11 14:26:49.641 1708-9067/?

I/IntentFilterIntentSvc: Verification 4 complete. Success:true. Failed hosts:.

This does not happen on Android 4 devices.

Any idea what the problem might be here? I have not found any information saying that In-App-Indexing is not supported on Android 4.

1

There are 1 answers

0
cincy_anddeveloper On BEST ANSWER

There is no minimum API level to use the App-Indexing api itself, but unfortunately for users below Jelly Bean, the API relies on a version of Google Search who's minimum is API 17. This is a simple repost of an answer from IanHannibalLake. Here's a link to the OG answer.