Android Intent Filter not working sometimes

Viewed 154

I have some problems with intent filter of dynamic link.

I use Firebase Dynamic Link for deferred deep linking, so I add intent filter in my activity at manifest file.

I already use custom scheme and add dynamic link scheme after my custom scheme in same activity.

It works fine when I launch app first time and keep that first instance. In that time, when I click dynamic link at samsung note app, my app and chrome browser are listed in chooser intent.

But after some hours without using my app so system restart my app when my app bring to foreground, my dynamic deep link intent filter not working. In this time, when I click dynamic link at samsung note app(I think it works with implicit intent), my app doesn't listed in chooser intent and also can't receive intent filter of dynamic link. But in same time, my custom scheme deep link working well. Only dynamic deep link scheme not working.

And also something strange one is that it only happens in my product flavor's release mode app. I have another flavor for develop so that flavor package name is my origin package name + ".develop" and it's debug mode. I do same thing in same time, my develop app's dynamic deep link intent filter working fine but only my product app doesn't work.

Is this happen relative with release mode or flavor? Or I just did something wrong with adding intent filter? I really don't know why this happen.

+) I test it at real devices, Galaxy Note8(Android 9, Pie) and Galaxy A32(Android 11).

manifest file of activity:

<activity
  android:name=".xxx.XxxActivity"
  android:launchMode="singleTask"

  android:screenOrientation="portrait">
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <!-- custom scheme -->
    <data
      android:host="xxx"
      android:scheme="xxx" />
  </intent-filter>
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>

    <!-- Dynamic link -->
    <data
      android:host="xxx.page.link"
      android:scheme="https"/>
  </intent-filter>
</activity>
0 Answers
Related