例如,在编写本机IOS应用程序时,您可以通过应用程序中的按钮单击打开本机"邮件"应用程序.电子邮件将预先填写某些数据(发送地址,主题,正文等).
如何在我的cordova应用程序中使用HTML5/Javascript在所有设备上模拟这个?
使用HTML5,您可以在.html文件中使用锚标记执行此操作.这是一个例子:
<a href="mailto:email@gmail.com?subject=Example Subject
&body=Thanks for the help!">Send an email</a>
Run Code Online (Sandbox Code Playgroud)
这将适用于所有设备,并使用本机功能来处理电子邮件任务.
小智 6
此外,由于cordova 3.6.3您还需要在config.xml中包含以下权限.
<access origin="mailto:*" launch-external="yes"/>
Run Code Online (Sandbox Code Playgroud)