Are you using geolocation in your PhoneGap/Cordova application and seeing two prompts?
I was. Even more odd was the fact that one had the "nice" application name and one was the full path to the index.html. See the screen shots below.
In all my Googling for this issue, all I could find were warnings about using geolocation before the deviceready event had fired. I definitely had not made that mistake, so I was truly confused. Also - none of these reports mentioned multiple prompts. To make things even more confusing - if I reran my application I would only get the second, ugly, prompt. An application is supposed to remember that you gave it permission, so what the heck, right?
Turns out that I made the same mistake others have made with Cordova 3.0 - I forgot to add the geolocation plugin!
cordova plugin add org.apache.cordova.geolocation
Even without the plugin you are still able to use geolocation. I have no idea why it prompted twice (I'm sure some of the engineers could explain it), but as soon as I added the plugin the second prompt went away.
Archived Comments
This is why I'll stick with 2.9 for now. PG 3.x is based on a good idea but not in a productively usable state (yet). Most of the docs are outdated or spread across a dozen sites. 2.x was easy to use for people with less mobile background but with 3.x it's harder to even start.
Hey Ray,
Do you know if the PhoneGap plugin for location is using the latest APIs for Android and iOS? I am specifically interested in the low power usage of Androids "Fused Location Provider" and the ability to detect "Activity Monitoring" such as walking, biking, driving, etc. I have not been able to find any documentation to indicate that the plugins where updated to include these.
Thanks.
As far as I know, no to all of what you said. I checked the plugin registry and didn't see anything related to it. You may want to ask on the Google Group to see if anyone worked on such a plugin and maybe never got around to publishing it. If you find anything at all, I'd love to hear it.
These are the Android docs for the activity monitoring stuff: http://developer.android.co...
It definitely seems like this could be handled in PG.
Thanks for the hint to the plugin not being installed.
My case was a bit different since I had run the 'plugin add' command.
But I also needed to run 'cordova prepare' or 'cordova build'.
Otherwise the plugin and cordova_plugins.js don't get copied from the platforms/{platform}/.staging/www folder.
I don't remember needing to run that on CLI version 3.2, but maybe I did it inadvertently.
I'm on 3.3.1 now.
Um, weird, how did you test w/o doing prepare or build in the first place? Afaik, if you do "cordova emulate" or run, it does a prepare/build for you.
I always run through XCode, not with cordova emulate or run.
I have a symlink set up in the ios folder (and same for android) so that my shared web app is always in sync with my platform folder.
I know that's not how Cordova 3.0 CLI wants me to do things, and I run the risk of wiping out my www folder by running prepare, etc.. I've been resisting the change to move to CLI completely but I'll probably have to start to avoid the risk.
I did the same mistake ;-)