PhoneGap 电子邮件编辑器插件 [英] PhoneGap Email Composer Plugin

查看:25
本文介绍了PhoneGap 电子邮件编辑器插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了一个简单的基于 jQuery Mobile 的应用程序,并尝试使用 Phonegap 对其进行编译.我希望用户能够通过电子邮件从应用发送一些内容,但我无法弄清楚.

I've built a simple jQuery Mobile based app, and trying to compile it with Phonegap. I'd like the users to be able to send some content from the app via email, but I can't figure this out.

我的代码:

<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" src="EmailComposer.js"></script> 
<script src="js/jquery-1.5.min.js"></script>
<script src="js/jquery.mobile-1.0a3.min.js"></script>
<script src="js/jsStuff.js"></script>
<script type="text/javascript" charset="utf-8">

// Wait for PhoneGap to load
//
function onLoad() {
    document.addEventListener("deviceready", onDeviceReady, false);
}

// PhoneGap is ready
//
function onDeviceReady() {
    // Empty
}

// alert dialog dismissed
function alertDismissed() {
    // do something
}

// Show a custom alert
//
function doEmail() {
    window.plugins.emailComposer.showEmailComposer("Subject","PlainTextBody", "recipient,recipient", "ccRecipient", "bccRecipient",false);
}
</script>

<link rel="stylesheet" href="style.css" /> 

然后:

<body onload="onLoad()"> 
<a href="#" onclick="doEmail(); return false;">Send email</a>

这根本不起作用.

我做了什么:

  1. 下载了 EmailComposer 插件.
  2. EmailComposer.js 移动到我的应用的根目录(Phonegap 项目 -> www).
  3. 添加了 EmailComposer.h &EmailComposer.m 通过在 Xcode 中右键单击我的 www 文件夹,然后添加"-->现有文件..."(参考类型:默认,将项目复制到目标位置..."被选中)
  4. 通过右键单击我的项目目标 ->获取信息"并将其添加到链接库中,将 MessageUI.framework 添加到我的项目中.
  1. Downloaded the EmailComposer plugin.
  2. Move EmailComposer.js to the root of my app (Phonegap project -> www).
  3. Added EmailComposer.h & EmailComposer.m to my project by right-clicking my www folder in Xcode, then "Add" --> "Existing Files..." (REference type: Default, "copy items into destination..." is checked)
  4. Added MessageUI.framework to my project by right clicking my project's target -> "Get info" and adding it to linked libraries.

任何帮助将不胜感激.

推荐答案

好吧,我知道这是一个旧线程,但看起来正确的答案尚未发布.对于可能会偶然发现此问题的未来读者:

Okay, I know this is an old thread but it looks like the correct answer has not been posted. For future readers who may stumble on this:

您必须将 EmailComposer 插件添加到 PhoneGap.plist 文件中,在 plugins 下添加一个新行,左列中包含EmailComposer",右列中包含EmailComposer".

You have to add the EmailComposer plugin into your PhoneGap.plist file, under plugins add a new row with "EmailComposer" in the left column, and "EmailComposer" in the right column.

这篇关于PhoneGap 电子邮件编辑器插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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