I had the same issue referred on this link. So to resolve the issue i did what klaus-donnert did,and also went here to download the latest plugin.... below is my xml file:
<preference name="phonegap-version" value="cli-6.4.0" />
<plugin name="cordova-plugin-mauron85-background-geolocation" spec="^2.2.5">
<variable name="ALWAYS_USAGE_DESCRIPTION" value="This app requires background tracking enabled to calculate the distance between you and Ecocompub partners" />
</plugin>
Next step was to test the app on my android, so after uploading the zip on phonegap.build, i read the qr code as usual, and .... the app crashed! it opens for a few seconds, but then closes...if i simply don´t use the plugin, the app runs well...does anybody experienced this problem?, i´m completely stuck.
Regards
So to help others that might have the same situation, the problem is NOT with the background mauron85 plugin, it was with my phonegap-plugin-push which was outdated since i was using cli-6.4.0...so if you want to use both plugins, you have to have on your xml file the following:
for background geolocation mauron85 plugin:
<preference name="phonegap-version" value="cli-6.4.0" />
<plugin name="cordova-plugin-mauron85-background-geolocation" spec="^2.2.5">
<variable name="ALWAYS_USAGE_DESCRIPTION" value="set this value, otherwise apple will refuse your app" />
</plugin>
for push-plugin from here:
<plugin name="phonegap-plugin-push" spec="1.8.4" source="npm">
Regards.
Related
i have an app build on vuejs and build with cordova. after i cordova build ios it successfully build the app but when i cordova emulate ios it is only showing app.vue components but not other components. the app.vue content is nav.vue. it only show the nav bar and make the other white screen. can someone please help me to solve this problem.
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<splash src="res/screen/ios/icon.png" />
</platform>
<access origin="about:*" />
<allow-navigation href="about:" />
<access origin="tel:" launch-external="yes" />
<access origin="mailto:" launch-external="yes" />
<preference name="scheme" value="app" />
this is my config.xml
Please try using the Safari Developer Tools on Mac to connect to your test device and check out the JavaScript console. Often times you will see the error there. On Android you can do this with Chrome.
I am answering my question. i solve this problem by just change the vue route history mode in to hash mode
like shown below
const router = new VueRouter({
mode: "hash",
base: process.env.BASE_URL,
routes,
});
and add the below code in vue.config.js file
devServer:{
https:false
}
I'm using these plugin on cordova#8.1.2:
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />
<plugin name="cordova-plugin-inappbrowser" spec="https://github.com/apache/cordova-plugin-inappbrowser" />
<plugin name="cordova-plugin-firebase"
spec="git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue" />
<plugin name="cordova-plugin-network-information" spec="^2.0.1" />
<plugin name="cordova-plugin-androidx" spec="^1.0.2" />
<plugin name="cordova-plugin-androidx-adapter" spec="^1.0.2" />
I've tried many different guides, I'm using legacy Build, set the p8 key on firebase for APN and in Android FCM messaging works smoothie. On IoS I can receive it only when the app is in the foreground.
I think the problem is related to "Disconnected from FCM" string. I obtain this log whenever I close or I switch my App.
You are using my old fork of cordova-plugin-firebase (https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue) which is only a partial fix for that plugin's multiple unresolved issues.
Please try using my fork of that plugin - cordova-plugin-firebasex - which resolves numerous issues with FCM notifications and adds new functionality.
Note: the latest version - cordova-plugin-firebasex#5.0.0 - contains breaking changes such that the API is no longer the same as cordova-plugin-firebase. If you decide to migrate, please read the documentation carefully.
I have a phonegap application that is working perfectly through the local server on the phonegap development iOS app.
Specifically, a call to
var ref = cordova.InAppBrowser.open('https://subdomain.domain.com', '_blank', 'location=no');
works fine in the dev app, however when pushed to phonegap build and accessed via the app installed via testflight, using Hydration to update easily, the button is entirely unresponsive.
I have a feeling that none of the plugins are being loaded, as the status bar is malfunctioning as well.
Here is the relevant part of the config.xml file:
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.0" />
<plugin name="cordova-plugin-statusbar" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
I know the insecurity of this, however, changing to the url i am trying to access does not change anything:
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<allow-intent href="*" />
</platform>
The button in question:
<span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> OR SIGN UP
The javascript relating to this button:
document.addEventListener("deviceready", function(){
deviceReadyDependantFunctions();
initializeApplication();
});
function deviceReadyDependantFunctions(){
alert('initialised!');
$('#signUpButton').unbind().click(function(){
console.log('here');
var ref = cordova.InAppBrowser.open('https://subdomain.domain.com?some=variable', '_blank', 'location=no');
ref.addEventListener('loadstart', function(event) { alert(event.url); });
console.log(ref);
});
}
Obviously, there's a bunch of debugging in there....
The "initialised" alert fires in all environments.
The event.url alert fires in the dev app but not in the test flight, hydrated application.
I have been trying everything I can find to rectify this... The only solution I have found is to use a simple href="theUrl.com" and let the system browser load it. Which is not a solution at all... I need to load the url in the app. It's a sign up page and is essential that it can be accessed from the app.
Things I have tried:
Every permeation of whitelisting, although there are varying docs saying that in app browser is/isn't affected by the whitelist plugin.
Using a different version of phonegap (<preference name="phonegap-version" value="cli-6.5.0" />) to no avail.
Checked that the plugins are present in the phonegap build "plugins" tab. They are.
Tried replacing the reference to cordova.js with phonegap.js. This didn't work at all.
The order of loading js files (the above call to inappbrowser is in a seperate js file). No difference.
What am I doing wrong?!
Or is there something weird with the TestFlight/Hydrated Application combination?
You can see the ridiculous commits I have made, as well as the full codebase here:
https://github.com/andycharrington/yfa/commits/master
Any advice would be massively appreciated.
Thank you.
Recompiling the unchanged code with Phone Gap Build this morning seemed to magically fix it. Don't you just love it when that happens? :)
I am running ionic and the ngCordova geolocation wrapper.
Here is a snippet from a controller using the plugin:
$ionicPlatform.ready(function () {
$cordovaGeolocation
.getCurrentPosition({timeout: 10000, enableHighAccuracy: false})
.then(permissionGranted)
.catch(permissionNotGranted)
.then(loadGmap)
.catch(handleGmapLoadError);
});
I run my app using:
ionic run ios --device
As the app comes up, I am asked permission to access the location of the phone as expected. I acknowledge it and my controller loads my location in google maps. I see the permission set in my ios settings reflect the setting made. when I open the app the second time, it asks again. This was unexpected behavior.
Most apps don't ask again and again. Has any one else seen this behavior and know what I should do?
you can try to add the permission in the config file (app/platforms/android/res/xml/config.xml)
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker" />
</feature>
and in the(app/platforms/android/AndroidManifest.xml)
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
i am trying to have a custom alert in my cordova based iOS application. i have installed the CDVNotification plugin using the CLI with the following commands:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git
so my config.xml has the following code:
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
i tried to call an alert by the following piece of code:
navigator.notification.alert("Message Here",alertCB,"Success","ok");
but the alert does not seem to show and the code after that is not working as well. seems to me as if there is an error somewhere, but i am unable to get to know why. i have put the event listener for device ready as well, though the alert still does not show.
what may be the reason for it?
I think you didn't invoked the class. Please make changes as given,
<feature name="Notification">
<param name="ios-package" onload="true" value="CDVNotification" />
</feature>
Hope it will help you :)