Phonegap build email plugin not recognized - email

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="default-568h#2x.png" 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.

Related

Ionic app gets stuck after splash screen for 0.005% of users

I'm having an issue in my Ionic app. After the splash screen the user cannot tap on any buttons, and can't interact with the app at all. It's either stuck or simply non-responsive.
This happens consistently for those devices, therefore they are never able to sign up.
This is my ionic info:
Ionic CLI : 5.2.3 (C:\Users\Simon K\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.11.10
#angular-devkit/build-angular : 0.801.3
#angular-devkit/schematics : 8.1.3
#angular/cli : 8.1.3
#ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.1.0, browser 6.0.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic 5.4.4, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 14 other plugins)
This is being reported by users on older devices. Most recently on a Samsung S5. I'm not sure if it's due to an older phone just freezing on our app, or perhaps it's some sort of network setting? Where it prevents Ionic from being responsive.
My config settings:
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="AndroidLaunchMode" value="singleTask" />
If there is anything else I can provide that might be helpful, please let me know. I am at a loss as to how such a problem can be fixed as I have not been able to replicate the issue.
Is this potentially an Ionic issue?
Run app on the device on which you are getting this issue check logs using chrome://inspect

Splash Screen on Ionic 3 android platform not working

I've been looking for an answer for like 3 days and can't find the answer for this, I have installed the plugin(cordova-plugin-splashscreen) and downgrade the plugin latest to 2.0.0, relocated my images and rename my folder /resources to /res, put it to platforms/android/src/main/res folder still nothing is working. here's my config.xml
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/icon/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/icon/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/icon/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/icon/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/icon/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/icon/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/icon/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/icon/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/icon/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/icon/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/icon/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/icon/drawable-port-xxxhdpi-screen.png" />
</platform>
<plugin name="cordova-plugin-splashscreen" spec="^2.0.0" />
When you create a new project from the CLI like for example:
ionic start testProject blank
you get a default splashscreen that works.
Add platforms:
ionic cordova platform add android
ionic cordova platform add ios
Don't change anything except for the splash.png image in the \resources folder.
Then run the command:
ionic resources
This will create all the resources and put them in the correct folders for all paltforms and update the config.xml file.
Run the project on your Android device:
ionic cordova run android --device
Use cordova-plugin-splashscreen version 4.0.1.
config.xml
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
<platform name="android">
<allow-intent href="market:*"/>
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png"/>
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png"/>
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png"/>
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png"/>
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png"/>
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png"/>
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png"/>
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png"/>
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png"/>
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png"/>
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png"/>
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png"/>
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png"/>
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png"/>
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png"/>
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png"/>
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png"/>
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png"/>
</platform>
Put the images in your project resource folder
Delete your www folder and try to run again
Hopefully it will work.

thread warnings in Phonegap/Cordova app

I am getting these two thread warnings compiling on an iPhone (iOS 6):
THREAD WARNING: ['InAppBrowser'] took '260.519043' ms. Plugin should use a background thread.
THREAD WARNING: ['Geolocation'] took '110.953857' ms. Plugin should use a background thread.
this is how I call the plugins in my code:
window.open("http://www.anaddress.com", '_system');
and this is how my config.xml looks like:
<?xml version='1.0' encoding='utf-8'?>
<widget id="my.id" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Hello Cordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<access origin="*" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<author email="mail#exam.de" href="http://www.example.com">Me
</author>
<content src="index.html" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
</widget>
Of course I installed the plugins using the cordova CLI:
$ cordova plugin add org.apache.cordova.inappbrowser
Any help would be appreciated, Thanks!
Look at the Phonegap Documentation and search for "Threading"
They explain that you might want to run the thread in the Background instead of the main one.
Apple doesn't like Blocked UI so you need to find a way to cancel your call if it takes more than 10 milliseconds.
Although you are not getting errors, just warnings.

cordova config.xml whats valid and whats not? trying to get navigator.notification.alert() to work, failing

I have been trying to sort this out for a while, and I have been trying to piece one together via google searches.. But I am recently noticing that most of the docs I come or have come across are for older versions of cordova/phonegap. I am using I 3.x or whatever the latest one is. Either way, my config.xml I feel is a mess. Another thing I noticed is I seem to have two config.xml's one is in the www folder, one is right at the same level as the www folder, the copy below is the one at the same level as the www folder which seems to be the one that listens to changes but Im not sure if there is a conflict there either.
I also found a copy of phonegap.js from the examples.. which I think is based on 1.7.0 and not my current version of phonegap/cordova. All in all I am trying to figure this all out so I can use things like the camera, so I can change things like the title of a alert box to go from a long path and file name then my message.
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.domain.coffee" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>title of app (wont put here)</name>
<description>
my long lengthy description
</description>
<author email="team#domain.com" href="http://www.domain.com">
domain development team
</author>
<content src="index.html" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
<access origin="*" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="UIWebViewBounce" value="true" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="EnableLocation" value="true" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<plugins>
<plugin name="Device" value="CDVDevice" />
<plugin name="Logger" value="CDVLogger" />
<plugin name="Compass" value="CDVLocation" />
<plugin name="Accelerometer" value="CDVAccelerometer" />
<plugin name="Camera" value="CDVCamera" />
<plugin name="NetworkStatus" value="CDVConnection" />
<plugin name="Contacts" value="CDVContacts" />
<plugin name="Debug Console" value="CDVDebugConsole" />
<plugin name="Echo" value="CDVEcho" />
<plugin name="File" value="CDVFile" />
<plugin name="FileTransfer" value="CDVFileTransfer" />
<plugin name="Geolocation" value="CDVLocation" />
<plugin name="Media" value="CDVSound" />
<plugin name="Capture" value="CDVCapture" />
<plugin name="SplashScreen" value="CDVSplashScreen" />
<plugin name="Battery" value="CDVBattery" />
<plugin name="Globalization" value="CDVGlobalization" />
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
<plugin name="org.apache.cordova.facebook.Connect" value="FacebookConnectPlugin" />
</plugins>
</widget>
note I have followed this most recently:
http://docs.phonegap.com/en/3.0.0/cordova_notification_notification.md.html#notification.alert
also an example of my message attempts would be:
navigator.notification.alert("my fancy message", "my title", "OK");

PhoneGap App Crashes while installing in my iPhone..

I have created the app using Phonegap 2.7.0 version.I have build the .ipa file and installed it.App crashed, But using Phonegap 1.6.0 Version it's working well. No crashes on installation.Please help me. this is my config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<widget>
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableLocation" value="false" /><!-- DEPRECATED -->
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<content src="index.html" />
<plugins>
<plugin name="Device" value="CDVDevice" />
<plugin name="Logger" value="CDVLogger" />
<plugin name="Compass" value="CDVLocation" />
<plugin name="Accelerometer" value="CDVAccelerometer" />
<plugin name="Camera" value="CDVCamera" />
<plugin name="NetworkStatus" value="CDVConnection" />
<plugin name="Contacts" value="CDVContacts" />
<plugin name="Echo" value="CDVEcho" />
<plugin name="File" value="CDVFile" />
<plugin name="FileTransfer" value="CDVFileTransfer" />
<plugin name="Geolocation" value="CDVLocation" />
<plugin name="Notification" value="CDVNotification" />
<plugin name="Media" value="CDVSound" />
<plugin name="Capture" value="CDVCapture" />
<plugin name="SplashScreen" value="CDVSplashScreen" />
<plugin name="Battery" value="CDVBattery" />
<plugin name="Globalization" value="CDVGlobalization" />
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
</plugins>
<access origin="*" />
</widget>
Can you please provide some code of your config.xml file.I have faced some similar problem.I forgot to write new version of the phonegap into the config.xml file and build using the new version and in config.xml file there is old version. so its make conflict for application and was crashed.
Note:
There are many upgradation are there for the phonegap 2.7.0 and sometimes however it will create issues if you use go straight with 2.7.0 from 1.6.0.
It may cause issues some times if you don't have any errors in your code.Hope this will help.
Ok.Good.
Put this into your widget tag and try to rebuild the application.
<preference name="phonegap-version" value="2.7.0" />