开启电子邮件应用程式网址 [英] Open email app url

查看:113
本文介绍了开启电子邮件应用程式网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加链接到我的网站检查您的电子邮件".如果用户使用的是暴民版本,则链接应在不存在的情况下在浏览器中打开邮件应用或电子邮件服务网址. 例如,用户具有test@gmail.com.如果用户没有gmail应用程序,则链接应在浏览器中打开gmail应用程序或 https://mail.google.com .也许最好启动用户首选的邮件应用程序而不是gmail.

I want to add link to my website "Check your email". If user is on mob version link should open mail app or email service url in browser if app is absent. For example user has test@gmail.com. Link should open gmail app or https://mail.google.com in browser if user has no gmail app. Maybe it's better to launch user preferred mail app instead of gmail.

Android

我发现 https://developer.chrome.com/multidevice/android/intents有意向链接意向://scan/#Intent; scheme = zxing; package = com.google.zxing.client.android; S.browser_fallback_url = http%3A%2F%2Fzxing.org; end

I found https://developer.chrome.com/multidevice/android/intents whith intent link intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;S.browser_fallback_url=http%3A%2F%2Fzxing.org;end

工作正常,但我不明白如何使用

It works fine but I can't understand how to do same thing with https://play.google.com/store/apps/details?id=com.google.android.gm&hl=ru or any other app

我还找到了 https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND 打开邮件应用程序,但intent://send#Intent; action = android.intent.action.SEND;结束无效

Also I found https://developer.android.com/reference/android/content/Intent.html#ACTION_SEND to open mail app but intent://send#Intent;action=android.intent.action.SEND;end not works

有人可以给我工作网址来打开gmail应用程序或默认邮件应用程序吗?

Can anybody give me working url to open gmail app or default mail app?

iOs

通用链接 https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12

Internet上有许多文章介绍了如何将您的网站链接到您的应用程序.但是,如何从我的网站启动另一个应用程序?

Internet has many articles how to link your site with your app. But how can I start another app from my site?

推荐答案

一种方法是在您的网站中添加链接,例如

One way to do this is to add a link in your website such as

<a href="mailto:user@domain.com?Subject=Hello%20User">Inbox me!</a>

如果您的Android手机上未安装任何邮件应用,则此方法将无效.因此,您必须安装一个可以监听此邮件事件/意图的应用程序,例如GMail.如果安装了两个或多个可以处理此事件/意图的应用,Android将显示一个应用列表,询问您使用哪个应用打开链接.

This will not work if you do not have any mail app installed on your Android phone. Therefore, you must install an app that can listen to this mail event/intent such as GMail. If two or more apps are installed that can handle this event/intent, Android will show a list of apps, asking you which app to use to open the link.

您接下来要做的是将自己的Android应用列为可以处理邮件事件/意图的应用之一.这是接收意图的地方.在您的Manifest.xml,声明您的活动,如下所示:

The next thing you wanna do is have your own Android app listed as one of the apps that can handle mail event/intent. This is where Receiving an Intent comes in. In your Manifest.xml, declare your activity as below:

<activity android:name="EmailHandlerActivity">
    <intent-filter>
        <action android:name="android.intent.action.SENDTO" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="mailto" />
    </intent-filter>
</activity>

参考: https://developer.android.com/guide/components/intents-filters.html

更新:

这是从从网页打开android应用程序的另一种方式.但是,要使其正常工作,您需要特别了解Manifest.xml中如何声明邮件应用程序的收件箱活动.如果活动声明如下:

Here is another way to Open android application from a web page. But for this to work, you need to know specifically how the Mail app's inbox activity was declared in the Manifest.xml. If the activity was declared as below:

<activity android:name="InboxActivity">
    <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="my_scheme" android:host="my_host" />
    </intent-filter>
</activity>

您可以将网址写为

<a href="intent://my_host#Intent;scheme=my_scheme;action=android.intent.action.VIEW;end">
    Go to Mail!
</a>

这篇关于开启电子邮件应用程式网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆