Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Nick_F_2
New Contributor III
77 Views

cordova.plugin.email-composer version

I am having issues with EmailComposer version 0.8.3 on a Sony Experia running Android 4.4.4 
Having researched the issue developers suggest using version 0.8.2.

When trying to select this option from the plugin manager it tells me 0.8.2 is not found, I also noted that the path to 0.8.3 is

EmailComposer (cordova-plugin-email-composer) and 0.8.2 is EmailComposer (de.appplant.cordova.plugin.email-composer).

 

Tags (2)
0 Kudos
7 Replies
Nick_F_2
New Contributor III
77 Views

I have managed to manually update the library by downloading and replacing the files in the plugin folder, I have also updated Fetch.json to 0.8.2, however I need to restart XDK to get the changes to be recognised, switching projects did not have the desired affect, all the debug tab refused to upload to the device citing the updated plugin as the cause. As I mentioned restarting XDK solved the issue.

Would still like to know why the Plugin manager could not handle the version change.

Nick_F_2
New Contributor III
77 Views

After the manual update the iOS build is now failing with the following error:-

.../cordova_project/platforms/ios/FRSViewer/Plugins/de.appplant.cordova.plugin.email-composer/APPEmailComposer.m:23:9: fatal error: 'Cordova/NSData+Base64.h' file not found
#import "Cordova/NSData+Base64.h"

This appears to be due to the fact I mentioned above about the plugin path being different and the version I require not showing on de.appplant.cordova.plugin.email-composer.

The Android version builds without any issues.

Where do I go from here.

PaulF_IntelCorp
Employee
77 Views

Nick -- replacing files in the plugins folder will not work well. Instead, if you have changes you want to make to a plugin, make those changes to a copy/clone of the plugin located outside the plugins folder (for example, outside your project folder or, if you want to keep the new plugin sources in your project, directly in the root of your project). Then use the "local plugin import" feature of the plugin manager to add that modified plugin to the plugins folder.

I see there are many forks of that plugin, which you might want to sort through, to see if any are fixing the bugs you are running. You can see the forks activity by going to the git repo for the plugin > https://github.com/katzer/cordova-plugin-email-composer/network < See the image below for how to add a local copy of a plugin (e.g., one that you have modified):

Screen Shot 2016-08-18 at 9.58.43 AM.png

Nick_F_2
New Contributor III
77 Views

Hi Paul

That is what I did in the end. I downloaded 0.8.2 from Github and then imported the plugin to the project.

Under Android it works fine, but the build is still failing for iOS because the path to the plugin in incorrect, it cannot find the plugin on the path shown in the build log below,

.../builds/build.2016-08-19.01-40-31.Od0mg0.tmp/cordova_project/platforms/ios/FRSViewer/Plugins/de.appplant.cordova.plugin.email-composer/APPEmailComposer.m:23:9: fatal error: 'Cordova/NSData+Base64.h' file not found
#import "Cordova/NSData+Base64.h"
        ^
1 error generated.

The only way I can fix this at the moment is to have 2 projects, one with 0.8.2 for Android and one with 0.8.3 for iOS but this is really messy and a pain to update the code in operate projects.

PaulF_IntelCorp
Employee
77 Views

Nick -- I agree, this is a clumsy solution, but it's what you'd have to do with CLI as well, since Cordova does not have the concept of specifying per-platform plugin versions. It's easy enough to add/remove plugins so you don't have to maintain two projects, or use links to have one project "get" its sources from the other, and use the "linked" project strictly for building.

Nick_F_2
New Contributor III
77 Views

I have got it working on Android now, but I need to have some links in the email so the recipient can view some images.

They are standard html <a href="http://my image link">Pic1</a>. When looking at the returned email body in the XDK everything is good, but when I install the app on an Android device the image URL has changed, even though the text says http://my image UTL/25991-day1_11-2-2016_1731/pic1.jpg which is correct and I pasted the URL from the email to here (Actual URL changed for security) but when I click the link it tries to load applewebdata://B39FE8CC-2ECB-483A-BD86-D270D1B3F87F/%3Ca%20href=

The image is not viewable.

This only seems to affect Android devices, HTML links in the iOS emails are fine.

PaulF_IntelCorp
Employee
77 Views

That "applewebdata://" prefix will only be understood on an iOS device and probably only in the standard iOS email app (e.g., it probably won't work when using gmail on an iOS device).

I have no idea how that plugin works, so you might have to talk to the developer to see if they have any idea as to why the underlying URL is getting changed to what appears to be an iOS-specific URL when used on a non-iOS platform.

Reply