any update on location error message : "/var/mobile/Applications/EF588D51-B58C-416A-A0A7-F1DB80D438/MyApplication.app/www//index.html" Would Like To Use Your Current Location"

3,343 views
Skip to first unread message

n@pster

unread,
Jul 16, 2010, 11:19:54 AM7/16/10
to phonegap
Hi,

I'm having this message :
"/var/mobile/Applications/EF588D51-B58C-416A-A0A7-F1DB80D438/
MyApplication.app/www//index.html" Would Like To Use Your Current
Location"

when I launch my application which is calling watchPosition javascript
function.
Most of the people using my application are scared having this
message, and refuse, so they cannot use the application (which is
unusable without localization)

I read many posts on this topic, but I didn't see any solution. I see
some poeple saying that it's fixed on recent version, but I'm using
last git version (of today : 16 of july 2010), and seems to not be
fixed.

Does any solutions have been found to solve this problem ? (if yes,
please give me some pointers)

Bobs Revenge

unread,
Jul 16, 2010, 4:08:52 PM7/16/10
to phonegap
I'd be most interested in this too. I've tried all the hacks listed
but nothing seems to work. I'll keep playing about but if anyone can
shed some light on this it would be great. My app is all ready to go
other than this.

Jesse MacFadyen

unread,
Jul 16, 2010, 7:48:37 PM7/16/10
to Bobs Revenge, phonegap
It looks like apple has changed the native mobile safari geolocation
implementation ( again ).

As a work around;
Open location.m from your phonegap lib and change all js callbacks from:
navigator.geolocation.*
to:
navigator._geo.*

In your JavaScript change references to navigator.geolocation to use
the navigator._geo object instead.

Hacky, but it seems to work until this is resolved.

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

Bobs Revenge

unread,
Jul 16, 2010, 9:02:20 PM7/16/10
to phonegap
Gah. That doesn't work for me either. I've had enough & give up! I'll
look at it again in the morning :)

On Jul 17, 12:48 am, Jesse MacFadyen <jesse.macfad...@nitobi.com>
wrote:
> It looks like apple has changed the native mobile safari geolocation  
> implementation ( again ).
>
> As a work around;
> Open location.m from your phonegap lib and change all js callbacks from:
> navigator.geolocation.*
> to:
> navigator._geo.*
>
> In your JavaScript change references to navigator.geolocation to use  
> the navigator._geo object instead.
>
> Hacky, but it seems to work until this is resolved.
>
> Sent from my iPhone
>

n@pster

unread,
Jul 19, 2010, 5:55:53 AM7/19/10
to phonegap
I try what you said, and it don't works for me. I change only on my
javascrit and location.m, clean all target and build, but I had
javascripts error saying that navigator._geo is undefined.

On Jul 17, 1:48 am, Jesse MacFadyen <jesse.macfad...@nitobi.com>
wrote:
> It looks like apple has changed the native mobile safari geolocation  
> implementation ( again ).
>
> As a work around;
> Open location.m from your phonegap lib and change all js callbacks from:
> navigator.geolocation.*
> to:
> navigator._geo.*
>
> In your JavaScript change references to navigator.geolocation to use  
> the navigator._geo object instead.
>
> Hacky, but it seems to work until this is resolved.
>
> Sent from my iPhone
>

Jesse MacFadyen

unread,
Jul 19, 2010, 6:47:08 AM7/19/10
to n@pster, phonegap
I checked in a fix, you will have to get the latest from github.

Sent from my iPhone

n@pster

unread,
Jul 19, 2010, 7:21:07 AM7/19/10
to phonegap
I have phonegap version of 16 of july 2010 as I said in my first
message. And I checked, there is no changes since this date. So
perhaps I did a mistake somewhere, can somebody can confirm this trick
works ?

On Jul 19, 12:47 pm, Jesse MacFadyen <jesse.macfad...@nitobi.com>
wrote:
> I checked in a fix, you will have to get the latest from github.
>
> Sent from my iPhone
>

n@pster

unread,
Jul 28, 2010, 12:15:14 PM7/28/10
to phonegap
up !

Does anyone using localisation is able to not have the error message :
"/var/mobile/Applications/EF588D51-B58C-416A-A0A7-F1DB80D438/
MyApplication.app/www//index.html" Would Like To Use Your Current
Location" ?

On Jul 19, 1:21 pm, "n@pster" <fabien.mo...@gmail.com> wrote:
> I have phonegap version of 16 of july 2010 as I said in my first
> message. And I checked, there is no changes since this date. So
> perhaps I did a mistake somewhere, can somebody can confirm this trick
> works ?
>
> On Jul 19, 12:47 pm, Jesse MacFadyen <jesse.macfad...@nitobi.com>
> wrote:
>
> > I checked in a fix, you will have to get the latest from github.
>
> > Sent from my iPhone
>
> > On 2010-07-19, at 2:55 AM, "n@pster" <fabien.mo...@gmail.com> wrote:
>
> > > I try what you said, and it don't works for me. I change only on my
> > > javascrit andlocation.m, clean all target and build, but I had
> > > javascripts error saying that navigator._geo is undefined.
>
> > > On Jul 17, 1:48 am, Jesse MacFadyen <jesse.macfad...@nitobi.com>
> > > wrote:
> > >> It looks like apple has changed the native mobile safari geolocation  
> > >> implementation ( again ).
>
> > >> As a work around;
> > >> Openlocation.m from your phonegap lib and change all js callbacks from:

Giacomo Balli

unread,
Jul 28, 2010, 8:29:05 PM7/28/10
to phonegap
well, it's not really an error message... ;)

n@pster

unread,
Jul 29, 2010, 3:09:05 AM7/29/10
to phonegap
ok, of course it's not (sorry for the mistake) but it's how it's looks
for users, and they are afraid to accept.
When we launch for the first time a phonegap application using
geolocation, a nice message is displayed :
"Allow you 'ApplicationName' to use your location data" (translation
from french) with two buttons : "Refuse" and "OK".
This message is nice and totally understandable by users, and it's ask
only one time in the life program : at first run.
After answering ok to this message, the second one (not user friendly
is asked) :
"/var/mobile/Applications/EF588D51-B58C-416A-A0A7-F1DB80D438/
MyApplication.app/www//index.html" Would Like To Use Your Current
Location"

If I understand well, this is asked because now, modern browsers can
support geolocation, so this is the request from the browser that try
to access geolocation. (correct me if I'm wrong). Why don't phonegap
just get geolocation from the hardware without calling geolocation
from browser ?

Jesse MacFadyen

unread,
Jul 29, 2010, 5:58:40 AM7/29/10
to n@pster, phonegap
In order to get the phonegap implementation you will need to wait for the deviceready event before calling geo functions.

Sent from my iPhone

n@pster

unread,
Jul 29, 2010, 7:31:18 AM7/29/10
to phonegap
Now it works !!!

Thank you :) This was my problem. I suppose that because I was not
wait for the deviceready, the geolocation from the browser was used,
not the one of phonegap.

Thanks again, with this, my app will be ready soon for applestore.

On Jul 29, 11:58 am, Jesse MacFadyen <jesse.macfad...@nitobi.com>
wrote:
> In order to get the phonegap implementation you will need to wait for the deviceready event before calling geo functions.
>
> Sent from my iPhone
>

RUFUS

unread,
Jul 30, 2010, 9:11:56 AM7/30/10
to phonegap
Does anyone know how to remove this from 0.8.0. We are heavily into
it on the very last stages and can not remove this notification. any
help will be appreciated.

On Jul 19, 6:47 am, Jesse MacFadyen <jesse.macfad...@nitobi.com>
wrote:
> I checked in a fix, you will have to get the latest from github.
>
> Sent from my iPhone
>

n@pster

unread,
Jul 30, 2010, 9:16:26 AM7/30/10
to phonegap
Sorry, I know only for trunk. But perhaps it's faster to migrate to
trunk.

I think you have to modify PhoneGap API to be able to do it. With
trunk code, you don't need to touch it.

Regards

Luke

unread,
Sep 16, 2010, 9:06:51 AM9/16/10
to phonegap
Following what Jesse said about modifying the Location.m file, I had
to do the additional work to get this to work...

1) modify Location.m in PhoneGapLib project. replace all references of
navigator.geolocation with navigator_geo

2) Copy phonegap.js to phonegap2.js and put in root of app. I have now
learned that every time I build my application and load it onto device
or simulator, the phonegap.js file is being regenerated. OK. Well I
need to modify it so lets just use another one and deal with the
hassles of upgrading in the future.

3) Modify the line (in phonegap2.js) that creates the constructor for
the navigator.geolocation on 626 to be ... if (typeof navigator._geo
== "undefined") navigator._geo = new Geolocation();

4) Now in your HTML whenever you want to use the PHONEGAP GPS stuff,
you can reference it with navigator._geo.getCurrentPosition or similar

5) Enjoy the ONE, and CLEAN, location alert permission without
revealing to your users your intelligence to use PhoneGap and build an
app with HTML/JS.

*** CAVEAT AND PLEASE HELP! ***
If I run the watchPosition function, I will get the first location
update with all sorts of stats. There after, It will always report an
error. I assume this sucks for this 30 second time of getting accurate
GPS on these things?
Reply all
Reply to author
Forward
0 new messages