Custom Url scheme handling Android

381 views Asked by At

I want to implement forgot password feature in my app. I get custom uri link from server. My link is clickable I use custom email app, not gmail app.

DevelopmentProject://forgotPassword?auth=authCode

Manifest Activity Definition

<activity
        android:name="com.sample.android.ForgotPasswordActivity"
        android:screenOrientation="portrait"
        android:theme="@style/AppetizeTheme">
        <intent-filter>

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="developmentproject"
                  android:host="forgotPassword"/>

        </intent-filter>
</activity>

On Api 16 ( 4.1.2 ) I am correctly redirected to app, and activity is being launched. In higher api get browser chooser ( 19, 21, 22 ). I tried launch activity from adb

adb shell am start -W -a android.intent.action.VIEW -d "DevelopmentProject://forgotPassword?auth=auth_token" com.sample.android

and it works when I use DevelopmentProject ( capital cases ) as scheme in manifest

How make it works on devices with API higher than 16 ?

0

There are 0 answers