Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperlinks with non HTTP schema in GMAIL

So I'm making mobile apps and want to do links to activate things in both iOS and Android using the same URL. I know how to do this already. my intent on android is something like :

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

My problem is when I go to test this and want to do a hyperlink in an email myapp://activity.action is not recognized as a url in gmail on android and displays as plain text. is there a way to fix this? how do i get non standard schema recognized by gmail as a link?

like image 757
1tSurge Avatar asked Oct 03 '14 20:10

1tSurge


People also ask

Can you put hyperlinks in Gmail?

You can easily hyperlink text in your Gmail drafts by clicking the hyperlink button or by using the CTRL (or COMMAND) + K option on your desktop.

Why can't I click on links in my Gmail?

Tap the menu button at the upper left corner of the app. Select “Settings” from the side menu. Scroll to the bottom and turn off “Open web links in Gmail”. Restart Gmail and try opening the hyperlinks again.

Why is link not clickable in email?

If your links seem to be unclickable when you test your messages, here are some things to look out for: In a plain text message, you want to make sure that you are including the full URL of the page that you want to link to, http:// and all. For example: example.com - Will not be clickable.


2 Answers

Custom schemes are not supported by gmail and chrome apps. Don't do this. Follow android guidelines for opening app from browser / link. See the following post Make a link in the Android browser start up my app?

like image 127
SohailAziz Avatar answered Sep 20 '22 13:09

SohailAziz


You can create intent filters for HTTP and HTTPS URLs as well as URLs with custom schemes.

For example, you might set up an intent filter like so:

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

    <data 
        android:scheme="http"
        android:host="example.com"
        android:path="/my-path" />

</intent-filter>
like image 21
Bryan Herbst Avatar answered Sep 16 '22 13:09

Bryan Herbst