I tried other solutions around here but no matter what I do the same permissions are asked during install of my app.
I tried removing a bunch of the "plugins" phonegap uses, namely: (from the config.xml)
<gap:plugin name="org.apache.cordova.battery-status"/>
<gap:plugin name="org.apache.cordova.camera"/>
<gap:plugin name="org.apache.cordova.media-capture"/>
<gap:plugin name="org.apache.cordova.contacts"/>
<gap:plugin name="org.apache.cordova.geolocation"/>
<gap:plugin name="org.apache.cordova.globalization"/>
Yet when I update my code and then try to install the apps it still asks for stuff like location.
Anyone who knows this?
It isn't the plugins that declare the permissions. The permissions are declared with feature elements like
<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="http://api.phonegap.com/1.0/device"/>
<feature name="http://api.phonegap.com/1.0/file"/>
<feature name="http://api.phonegap.com/1.0/network"/>
Related
html5 jquery mobile hybrid phonegap app on android s6 sport using phonegap desktop and phonegap developer app on phone. Not sure of phone gap version (cli not installed properly, tried but opening prompt gives an error) but it is a recent (last week) install.
Using call in chrome opens phone app dialer but not in test phonegap app - click does nothing. Also mailto: and http: acts the same, works in chrome not in app.
The exact html is:
<a id="btn_phone" href="tel:18001231234" rel="external" data-role="button" data-icon="phone"></a>
I added to the config.xml
and based on comments removed the catch-all
which got it working for others but not in my case.
In config file is this:
<access origin="tel:*" launch-external="yes"/>
<access origin="geo:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<plugin name="cordova-plugin-whitelist" version="1"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
as stated I removed this:
<access origin="*"/>
So based on everything I've read that should be all I need to do but it is still not working.
Two questions:
Does anyone know a fix for this?
Is there a way to debug this on the phone to see what is failing?
thanks
I struggled with this forever and eventually did the following which worked:
In the HTML:
<input type="button" href="tel:+1-800-555-1234“ class="phone-number" value="1-800-555-1234"/>
In the Javascript:
$(‘.phone-number’).bind(click, function(e) {
e.preventDefault()
var phoneLink = $(e.currentTarget).attr('href');
window.open(phoneLink, '_system', 'location=yes’);
}
What is your cordova version? I think your problem is the white list plugin declaration.
Try this:
<feature name="Whitelist">
<param name="android-package" value="YOUR_WHITELIST_CORDOVA_PATH" />
<param name="onload" value="true" />
</feature>
More info on how to configure White List here: https://www.npmjs.com/package/cordova-plugin-whitelist
NOTE TO ALL This answer does NOT work for CLI. <feature> in this context is meant for SDK and those using an IDE. See Documentation The feature Element
Quote:
If you use the CLI to build applications, you use the plugin command to enable device APIs. This does not modify the top-level config.xml file, so the <feature> element does not apply to your workflow.
If you work directly in an SDK and using the platform-specific config.xml file as source, you use the <feature> tag to enable device-level APIs and external plugins. They often appear with custom values in platform-specific config.xml files.
I developed a cordova app which uses the contacts plugin. I tested it on android with my linux machine and everything works fine. Now I am trying to use phonegap build to create an ios package. My problem is with the contacts plugin, the code for getting contacts doesn't work when I use it in IOS. I tried adding this line to my config.xml:
<gap:plugin name="org.apache.cordova.contacts" version="0.2.11" />
But it didn't help.
The UI also looks different (everything is smaller). This is not an IOS compatibility issue - I tried the apk created by phonegap build for android on the same android phone I used for development and the UI has the same problems it had on IOS. What am I doing wrong?
Thanks.
Try adding this to config.xml
<feature name="Contacts">
<param name="ios-package" value="CDVContacts" />
</feature>
For android you have to use this
<feature name="Contacts">
<param name="android-package" value="org.apache.cordova.ContactManager" />
</feature>
Please refer this for more details
http://docs.phonegap.com/en/3.0.0/cordova_contacts_contacts.md.html
I'm trying to build a PhoneGap app for android. I need to use the Sqlite plugin.
According to PhoneGap documentation I need to declare the plugins in config.xml and I'll be good to go but I'm not. It just won't work.
I'm using the Sqlite plugin this way:
window.db = window.sqlitePlugin.openDatabase({name: "my_db"});
The sqlitePlugin is undefined. I'm using the following plugins as well, so if anything's worth noting, please share them with me.
<gap:plugin name="com.phonegap.plugins.sqlite" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.vibration" />
Edit: One important question. Do I need to include the plugins js file in my index.html using the script tag?
The line I see for sqlite plugin in the phonegap build plugins repository is
<gap:plugin name="ch.zhaw.sqlite" version="2.0.0" />
Does it work better if you replace the line in config.xml?
I'm writting an android and iphone app using phonegap 3.0.
So far I have been only compiling the apps remotely using phonegap build.
Now I'm trying to add the geolocation plugin to my app, and in iphone was easy, since I only had to modify the config.xml file.
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
So far so good, the problem was that when adding geolocation to android, the documentation indicates that I have set the following configuration:
(in app/res/xml/config.xml)
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker" />
</feature>
(in app/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" />
But I don't have an AndroidManifest.xml file. I could generate the complete android app using:
cordoba platform add android
But I'm not sure if this is what I should do.
Is is what I should be doing? or there is a way to add geolocation without generating the entire android project?
I am a bit confused because you say you are using phonegap 3.0 and you also mention phonegap-build (highest is 2.9). If you are in fact using phonegap-build, the only thing you need is in your config.xml:
<feature name="http://api.phonegap.com/1.0/geolocation"/>
I had the same problem. My geolocation worked on IOS but not on Android. So I Added to config.xml
<feature name="http://api.phonegap.com/1.0/geolocation"/>
As explained by Dom.This was not sufficient. I wanted to share what I did step by step because I lost about 18h of dev time looking for the solution.
This however did not reslove the problem. So I added the plugin using my IDE.
This added the following to the config:
<plugin name="cordova-plugin-geolocation" version="2.2.0" />
I then went inside the plugin.xml under the plugin directorty.
And looked if the following was added.
<!-- android -->
<platform name="android">
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</config-file>
...
It was, so I rebooted the device. (on the Ionic forum they say, it might help)
When reinstalling the app I checked for the permission. And it was added. So for the bad Q of the last pic but I took a pic with my cam for it. Hope this helps
I am Using PhonegapBuild Not eclipse for build my application.
We are not using any custom plugin. I read the post about plugin but i think it's for custom plugin so i didn't change anything in XML and it gives me error "plugin unsupported: splashscreen" So can any one help me how to get rid of it.
In Config.xml splash plugin line is same as mentioned in docs and it's as below
For Android:
<gap:plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
For IOS:
<gap:plugin name="SplashScreen" value="CDVSplashScreen" />
Please help me..
Screenshot is below
I removed all plugin from my config.xml for Android as well IOS also.Then i successfully upload my Zip file for Build and its Build and Working Fine in Device..
As far as I can tell, you must be confused with the feauture and the plugin
Try using the following for the feauture
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen"/>
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
Try using the following for the plugin
<gap:plugin name="cordova-plugin-splashscreen" source="npm" version="2.1.0" />
But I also have a problem with my splashscreen, so it may not be 100% correct. My problem is that my images are not being recognized.