Page 1 of 3

Emailcomposer

Posted: Thu Oct 17, 2013 5:24 pm
by Francisco Narro

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


Emailcomposer

Posted: Thu Oct 17, 2013 7:17 pm
by Maryna Brodina

Hello! Let me check. I'll update.


Emailcomposer

Posted: Thu Oct 17, 2013 8:15 pm
by Maryna Brodina

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


Emailcomposer

Posted: Thu Oct 17, 2013 9:39 pm
by Francisco Narro

Do you think it's valid for IOS too?


Emailcomposer

Posted: Fri Oct 18, 2013 5:23 am
by Kateryna Grynko

Hi Francisco,

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


Emailcomposer

Posted: Fri Oct 18, 2013 9:05 am
by Francisco Narro

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

in this line of EmailComposer.js

49 .. cordova.addConstructor(function() {


Emailcomposer

Posted: Fri Oct 18, 2013 1:08 pm
by Francisco Narro

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


Emailcomposer

Posted: Fri Oct 18, 2013 2:17 pm
by Kateryna Grynko

Hi Francisco,

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


Emailcomposer

Posted: Mon Oct 21, 2013 8:01 am
by Francisco Narro

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


Emailcomposer

Posted: Mon Oct 21, 2013 9:18 am
by Maryna Brodina

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