Francisco Narro
Posts: 0
Joined: Thu Oct 03, 2013 9:58 am

Emailcomposer

Hi, I found in google this lib to send email

https://github.com/phonegap/phonegap-...

Do you think it ́s possible to use in my project?

How?

Thanks in advance

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Emailcomposer

Hello! Let me check. I'll update.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Emailcomposer

You can use this plugin as well as any other PhoneGap plugin. Here is a description:
1) On Source tab in necessary folder create folder emailComposer and inside that folder file EmailComposer.java (from here https://raw.github.com/phonegap/phone...)
Image
2) Replace line prepackage org.apache.cordova;/pre with the following
prepackage com.phonegap.plugins.emailComposer;/pre
3) Change config.xml file, add the following code:
pre<feature name="EmailComposer">
<param name="android-package" value="com&#46;phonegap&#46;plugins&#46;emailComposer&#46;EmailComposer"&#47;>
<&#47;feature>/pre
Image
4) Create new JS asset with content https://raw.github.com/phonegap/phone...
5) To test on button click run the following code:
prewindow&#46;plugins&#46;emailComposer&#46;showEmailComposerWithCallback(null,"Look at this photo","Take a look at this:",["example@email&#46;com", "johndoe@email&#46;org"],[],[],true);/pre

Francisco Narro
Posts: 0
Joined: Thu Oct 03, 2013 9:58 am

Emailcomposer

Do you think it's valid for IOS too?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Emailcomposer

Hi Francisco,

I think yes: https://github.com/phonegap/phonegap-...

Francisco Narro
Posts: 0
Joined: Thu Oct 03, 2013 9:58 am

Emailcomposer

Sorry, not work.
Firefox give me this error: "ReferenceError: cordova is not defined"

in this line of EmailComposer.js

49 .. cordova.addConstructor(function() {

Francisco Narro
Posts: 0
Joined: Thu Oct 03, 2013 9:58 am

Emailcomposer

Maryna,

I have create a new application, and I follow your instructions, but I have the same result:

Uncaught ReferenceError: cordova is not defined EmailComposer.js:49

(anonymous function) EmailComposer.js:49

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Emailcomposer

Hi Francisco,

This won't work on desktop browser. You should export your app as APK, install on device and test there.

Francisco Narro
Posts: 0
Joined: Thu Oct 03, 2013 9:58 am

Emailcomposer

Hi,

I test this in Android and it runs ok.

I have make the changes to IOS and it don't work. I see in the instructions that I have to add the - MessageUI.framework -.

¿How can I do it?

In IOS I did this:

  • Create a folder "emailComposer" in IOSmyprojectCordovaLibPlugins

  • Create two files: EmailComposer.h and EmailComposer.m

  • Modify config.xml and add: code <feature name="Plugin">
    <param name="ios-package" value="CDVPlugin"&#47;>
    <&#47;feature>
    <feature name="EmailComposer">
    <param name="ios-package" value="EmailComposer"&#47;>
    <&#47;feature>
    /code

  • Modify myproject-Info-.plist and add: code <key>EmailComposer<&#47;key>
    <string>EmailComposer<&#47;string>

    /code

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Emailcomposer

Hello! You would need to export app to xCode and add MessageUI.framework manually.

Return to “Issues”