When receiving an OAuth redirect in my app, the Android "Open with" menu shows with 2 choices, both being my application. The desired behavior would be to simply proceed into the app without showing the "Open with" menu.
This issue started happening after I added a new intent-filter to capture "text/plain" shares from other applications.
Here are my intent-filter that are part of the same activity:
<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="com.app" android:host="app" android:pathPrefix="" />
<data android:scheme="com.app" android:host="oauth" android:pathPrefix="" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
And the Intent captured using adb logcat
:
{act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=com.app://oauth?code=4pZliH2NrWWoypXnsBqEOjbMramW70&state=6AImyjKHt7ZhYPuk_pJjRQ flg=0x14000000 pkg=com.app cmp=android/com.android.internal.app.ResolverActivity (has extras)}
Since they are a part of the same activity I assumed that it wouldn't prompt the user to select an option. I also assumed action.VIEW
would only match the first intent as well.
When attempting to combine intents, the redirect failed to work entirely. And from researching, it doesn't seem like there is a way to prioritize intents.
Any suggestions would be greatly appreciated. Thanks!
I have discovered the issue. I was using a library (AppAuth-Android) that was injecting its own ...
After removing the library, the issue was resolved. Thanks for the suggestion!