Cannot get gmail for Android to open custom url scheme or intent url: //

I implemented a custom URL scheme on Android and iOS, with the idea that we send the user an “activation” that clicks on the link that launches their own application.

Technically, we send an email in HTML format with a link, for example:

<a href="myapp://activate/accountId/uniquetoken">Click to activate</a>

It works fine on iOS, but it doesn’t work on Android.

I saw several other SO posts and similar things that the android itself should handle a custom URL scheme , but indicate that it is a Chrome browser and GMail for Android application that robs the user myapp://URL.

Following the recommendations of some of these posts, I tried to create an intent url. I tried all of the following

intent://activate#Intent;scheme=myapp;package=com.mycompany.myapp;end

#Intent;action=activate;end

#Intent;component=com.mycompany.myapp/.ui.MainActivity;end

intent://#Intent;component=com.mycompany.myapp/.ui.MainActivity;end

but none of them worked. None of them were available from the GMail Android app on Android 6, and the android documentation in the format for the intentional uri is incredibly poorly documented. The best I can find is "programmatically create your intent in Java and then call .toUri on it" (this is how I produced most of the broken oral uri above)

Any help would be greatly appreciated


Update 1. Here is my activity and intent from the Android manifest

    <activity android:name=".ui.MainActivity" android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <!-- load via URL scheme -->
        <intent-filter>
            <data android:scheme="myapp" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

I tried setting up a web server that "mirrors" back to the user application schema, and this works for both Android and iOS

<a href="http://mycloudserver.net/myapp/activate/accountId/uniqueToken">Click</a>

This page redirects 302 to

myapp://activate/accountId/uniqueToken

- (Chrome android) , - , ( ) Gmail android.

, .

iOS Safari, , .

+4
1

, . URL- , iOS, Android Chrome , . , .

, Branch.io , , . Universal Links (iOS 9+), URL (iOS < 8, Android), ( Android) Chrome Intents (Chrome Android), , . , , , . iOS , , .

, - , Branch . !

+3

Source: https://habr.com/ru/post/1650242/


All Articles