views:

602

answers:

5

How do you change the string on the alert saying: "(Appname/whatever it is) would like to use your current location"?

Of course, I only want to change the appname part. Because when you use the framework phonegap, the string is VERY ugly, something like this: "/var/mobile/Applications/157EB70D-4AA7-826E-690F0CBE0F/appname.app/www/index.html".

Someone having an idea?

A: 

What is the Bundle display name of your project?

Try changing manually from the default value ${PRODUCT_NAME} and see..

That Permission to use location alert picks your bundle display name only!!

Prakash
It doesnt matter, I have set both "bundle display name" and "bundle name" properties manually! The one I havent set manually is "Executable file" which is ${EXECUTABLE_NAME}. But if I change that I cant compile, obviously..
blmstr
A: 

I found the answer myself and I thought I would share it with you! In iPhone OS > 3.0 Safari supports geolocation and therefore in phonegap when you use the navigator.geolocation it triggers the geolocation in Safari and because Safaris permission alert text is printing the url of the site it gets ugly when you use it with phonegap. I solved this by not using navigator.geolocation. Not the best solution but a working one.

blmstr
A: 

so how do you get the geolocation of the device without using navigator.geolocation?

JKLZ
A: 

I'm late to the party here, but will answer the question for reference. The answer is to use the geolocation functions found in phonegap.js which is included with Phonegap. You will be able to find such instructions on the Phonegap site at http://www.phonegap.com.

If you use navigator.geolocation, you are using the default Safari geolocation system. This happens as PhoneGap works by running your pages effectively in a Safari instance. If you include phonegap.js into your site, you can use a separate geolocation method exposed by PhoneGap's Objective-C code, which will present the behaviour seen in other apps where it asks for permission from [your app name].

Tim Rogers
A: 

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?

http://groups.google.com/group/phonegap/browse_thread/thread/8067c2037816a9ad

Luke Ollett