Sandeep Singh
Sandeep Singh

Reputation: 1127

Not able to open tha app from URL using Custom URI scheme

I'm trying to open my app from URL which is send either in SMS or in Email. But it will not open my application.

Here is the code i have used in AndroidManifest File.

 <activity
        android:name=".TestActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <data
                android:host="http"
                android:scheme="m.special.scheme" />

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    </activity>

Here is the URL i have passed in the email

http://m.special.scheme/other/parameters/here

I have also try this m.special.scheme://other/parameters/here

But this will show as a static text in email not as a URL.

Help me!!!

Upvotes: 0

Views: 1103

Answers (2)

Kishan Vaghela
Kishan Vaghela

Reputation: 7938

Your Intent filter is wrong. You are providing wrong scheme and host value.

<activity
        android:name=".TestActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <data
                android:scheme="http"
                android:host="m.special.scheme" />

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    </activity>

Upvotes: 1

Buddy
Buddy

Reputation: 11028

You have the "hosts" and "scheme" values swapped.. it should be:

<data android:host="m.special.scheme" android:scheme="http"></data>

Then this URL http://m.special.scheme/other/parameters/here should open your app...

See this answer for more info.

Upvotes: 0

Related Questions