Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling https schema in intent-filter

I have an intent filter in the Manifest which handles taps on urls, if url match filter data my application starts.

<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="*" port="8765" android:path="/mypath" />
</intent-filter>

Intent filter works when schema is "http" but if I change it to "https" intent filter doesn't do anything and link starts to load in a browser.

Does anybody know what is the problem here?

like image 203
Maxim Avatar asked Aug 07 '26 12:08

Maxim


1 Answers

Just add an extra data line to your filter:

<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="*" port="8765" android:path="/mypath" />
  <data android:scheme="https" android:host="*" port="8765" android:path="/mypath" />
</intent-filter>
like image 54
brk3 Avatar answered Aug 09 '26 02:08

brk3



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!