Droidman
Droidman

Reputation: 11608

Are there any (poorly documented) changes to IntentFilter's and exported components in Android 12?

We use declarations like the following one (Manifest) to link to certain parts of the app:

    <activity
        android:name=".some.package.SomeActivity"
        android:launchMode="singleInstance"
        android:exported="true">

        <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="https" />
            <data android:host="*.some-domain.com" />
            <data android:path="/native/foo" />
        </intent-filter>

    </activity>

On devices running Android 12, this suddenly stopped working, e.g. scanning a QR code containing a certain URL automatically opens it in the default browser. Prior to Android 12, the system offers to open those URLs in our app when tapping on links like https://some.domain.com/native/foo/bar/. I went through the changelog and was unable to find anything that could explain this behavior (considering we already set exported="true").

What am I missing and how can I tell the system to offer our app to handle those specific URLs?

Upvotes: 3

Views: 81

Answers (1)

penkzhou
penkzhou

Reputation: 1210

UPDATE After test some case, I found you should change your scheme from https to non https string, such as your_app_string. If you still want to use https as your scheme, you should check the doordash's tech blog.

Your should make the android system can verify your scheme.In simple words,start with android 12(api 31), you need Declare the association between your website and your intent filters by hosting a Digital Asset Links JSON file at the following location:

https://some.domain.com/.well-known/assetlinks.json

official doc reference here

Upvotes: 1

Related Questions