I installed the geolocation plugin in cordova
cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="your usage message"
I noticed that with android it works well, but with ios no.
to solve the problem I inserted this rule into the info.plist.
<string>NSLocationWhenInUseUsageDescription</string>
<key>Test geo iphone</key>
After entering this rule the app finally asks me permission to detect the position.
Why cordova does not automatically insert this rule in the info.plist file?
Grazie Ciao!
Related
Error when building for the device
I am getting an error when I try to build for the device(ionic cordova run android --device). For some reason it is not creating platforms/android/app/build/outputs/apk/debug/app-debug/apk. I have tried removing and adding android different versions. Also, I have tried ionic cordova run android --no-native-run and it loads but with a blank screen.
I found 2 solutions, so if you have a problem with running the device feature:
Update CLI!
Remove Android
ionic cordova platform rm android
Add android#6 and run ionic cordova run android --no-native-run
OR
3.add the latest android#latest and run ionic cordova run android.
Those two worked for me, depending on the version of your projects!
How to update my apk every time I make changes on my template or code changes.
You can use the livereload feature of ionic cordova emulate or ionic cordova run to run the code on an emulator or device and see the changes live as as you code.
Here's how with the emulator:
ionic cordova emulate android --list to get a list of available emulator targets to copy into the next command.
ionic cordova emulate --livereload android -- --target="[TARGET]"
See the CLI docs for more info.
You can do livereload from a ionic cordova run <platform>, if it's an apk i assume that is for android so you can do this:
ionic cordova run android --livereload
For more options like specific port you can take a look on the docs
I installed call number plugin on ionic. In fact it created a directory to ionic-native but I have the error "console.warn: Ionic Native: tried calling CallNumber.callNumber, but the CallNumber plugin is not installed.".
How I can fix this error?
Please be sure that you installed the cordova plugin:
ionic cordova plugin add call-number
Maybe you can try deleting the platforms and adding them again.
ionic cordova platform remove ios
ionic cordova platform remove android
ionic cordova platform add ios
ionic cordova platform add android
Let me first say. Each time i run
ionic cordova build android --dev
It first run this command
cordova platform add android
At the start of the project I already added the android platform successfully. So I dont know why on every build it has to add android platform again. But each build works perfectly well on my phone. Then yesterday when I tried to run
ionic cordova resources
and it says
no platform detected. Please run ionic cordova platfrom add
Please help
It was working fine with Cordova 1.6.1,but trying with cardova 1.8.0 ,
I get these alerts:
1. Cordova Facebook Connect plugin fail on login!
2. Cordova Facebook Connect plugin fail on auth.status!
What can i do?
I have two phones one with android 2.2.1 and the other with android 2.3.3 and I get the error on the 2.2.1 but not on the 2.3.3 not sure why but maybe you should try installing on another phone. I'm wondering if its timing out as this old HTC is slow.