Send link with custom scheme through Gmail

﹥>﹥吖頭↗ 提交于 2019-12-10 11:36:48

问题


I'm trying to send a deep link that opens my Android app:

String body = "<a href=\'myscheme://myurl?Id=37\'>Link to simulation</a>";
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "share");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
startActivity(Intent.createChooser(emailIntent, "Email:"));

But when I got the email with the code above and with my Gmail through desktop chrome brower I got only plain text.
When I send http://myurl I do get the link.

Is it possible to send link with custom scheme?


回答1:


Use tinyurl api to generate short link http://tinyurl.com/api-create.php?url=myscheme://myurl?Id=37 you get http://tinyurl.com/ofmudsw



来源:https://stackoverflow.com/questions/18944105/send-link-with-custom-scheme-through-gmail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!