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.
My code:
<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" />
And then:
<body onload="onLoad()">
<a href="#" onclick="doEmail(); return false;">Send email</a>
This does nothing at all.
What I've done:
- Downloaded the
EmailComposer
plugin. - Move
EmailComposer.js
to the root of my app (Phonegap project -> www). - 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) - Added
MessageUI.framework
to my project by right clicking my project's target -> "Get info" and adding it to linked libraries.
Any help would be appreciated.