简体   繁体   中英

Launch my app from link in email, but link was filtered by gmail , How can I do ? ask for Help !

I want to launch my app from link in email. this the link is base on special schema.

I use the in my app's activity (AndroidManifest.xml):

<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="ace" android:host="samuel"/>
</intent-filter>*

In my app, when user click the 'Share by Email' button, It will open gmail app to send email.

Intent mailIntent = new Intent(android.content.Intent.ACTION_SEND);
mailIntent.setType("plain/test");
mailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_CC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_BCC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
mailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailBody));

startActivity(Intent.createChooser(mailIntent, "You need to configure gmail..."));*

'emailBody' contain the special URL link: ace:adid=9ca98efe-ef48-47c0-aff5-058224b3093d


When I send this email to others, The recipient open the mail, there is no such a special URL link.

I do not know why? When I use other email (not gmail) send the same html content, It's ok. the recipient can see the special URL link.

@Samuel.Cai I believe that @Oldarney was telling you to put your URL into TinyURL.com (I did it for you) and put this in your email body: http://tinyurl.com/a7y2mzn

It worked for me, although you have to be online for your browser to do that redirect unfortunately. Your safest bet is probably to do

'emailBody' = ace://samuel?adid=9ca98efe-ef48-47c0-aff5-058224b3093d

and telling the users to copy-paste into the browser if the link doesn't work!

Hope that's helpful.

There might be some filtering out. I was able to bipass a similar restriction by using tinyurl. You could use a small php script to convert a get request to an ace:// link.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM