Android Question Open App using URL & Intent scheme

nobbi59

Active Member
Licensed User
Longtime User
Hello,

I want visitor of my website to be redirected to my app. So When the browser is redirected to

myapp://home my main activity should open up.

Im using the following code, but im not getting redirected:

Manifest:

B4X:
AddActivityText(Main, <intent-filter>
  <action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:host="URL" android:scheme="myapp"></data>
</intent-filter>)

Website: (JS)

B4X:
window.location = "myapp://home";

I tried many variations like:

window.location = "intent:#Intent;scheme=startci://open?url_param=home;package=com.myapp;S.browser_fallback_url=http%3A%2F%2Ftest.com;end";

and

B4X:
AddActivityText(Main,
<intent-filter>
            <data android:scheme="startci" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
)

But nothing is working, either the browser shows nothing or Im redirected to "test.com"(second example)

Can somebody help me?
 
Top