Android app not opening from URL using intent-filt

2019-09-01 07:47发布

问题:

I am trying to open my app from a website and read some text from link. The URL will be like codespike.com/?code=xxxx. I need to read the xxx but my problem is that I am not able to open my app when this specific URL in being opened in the browser. For testing I also used a webiste bfinstafollowers.com, not working with this either. This is what I am trying.

<activity
            android:name="com.softech.betforinstafollowers.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:host="bfinstafollowers.com" android:scheme="http"
                    android:pathPrefix=".*"/>
            </intent-filter>
        </activity>

also tried with <category android:name="android.intent.category.BROWSABLE"/> and without android:pathPrefix=".*" but my app doesnt open.

回答1:

Solved my issue, as it turns out regular http, https doesn't work. I had to create my custom scheme for this purposes.