问题描述:

I built an app that utilizes the phonegap build plugin for composing emails with attachments. The app is working well on iOS devices but email is not working on Android devices. Here is part of my config.xml:

<preference name="disable-cursor" value="true" />

<preference name="orientation" value="default" />

<preference name="fullscreen" value="true" />

<preference name="webviewbounce" value="false" />

<preference name="permissions" value="none"/>

<gap:platform name="android" />

<preference name="loadUrlTimeoutValue" value="700000" />

<gap:config-file platform="android" parent="/manifest"><application android:hardwareAccelerated="false"/></gap:config-file>

<icon src="icon.png" hover="true"/>

<icon src="icon.png" default="true" width="57" height="57"/>

<icon src="icons/android/mdpi.png" gap:platform="android" gap:qualifier="mdpi" />

<icon src="icons/android/hdpi.png" gap:platform="android" gap:qualifier="hdpi" />

<icon src="icons/android/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />

<icon src="icons/android/xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />

<gap:splash src="splash.png" width="270" height="480" />

<gap:splash src="[email protected]" gap:platform="ios" width="640" height="1136"/>

<splash src="splash.png" />

<feature name="http://api.phonegap.com/1.0/file" />

<feature name="http://api.phonegap.com/1.0/network"/>

<feature name="http://api.phonegap.com/1.0/contacts"/>

<plugin name="com.jcjee.plugins.emailcomposer" spec="1.4.6" source="pgb" />

<plugin name="cordova-plugin-file" spec="3.0.0" source="pgb"/>

and my javascript that calls the email composer:

 window.plugins.emailComposer.showEmailComposerWithCallback(null, email_subjectdef, "", email_default, [], [], true, [compatibleAttachment, compatibleAttachment2]);

I am currently trying the jcjee plugin but also tried the deappplant plugin.

The error I receive on the device is:

"cannot read property 'emailcomposer' of undefined.

Thanks for your help!

网友答案:

I was able to determine what the error was an the email plugin is working fine on Android. I had been using an iframe to display a PDF file. Apparently Android 4.4.2 does not like iframes, at least not in a Phonegap Build project. Removing the iframe solved my problem.

相关阅读:
Top