开发者

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

开发者 https://www.devze.com 2023-03-19 05:52 出处:网络
I want to launch my app from link in email.this the link is base on special schema. I use thein my app\'s activity (AndroidManifest.xml) :

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 th开发者_StackOverflow中文版e 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.


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.


@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.

0

精彩评论

暂无评论...
验证码 换一张
取 消