Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-13-2009, 04:47 AM   #1 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Question CLLocation and UIWebView???

Hi all,

Is it possible to get the current gps position with CLLocation save it locally with Local Storage -- then read it from a page using javascript within UIWebView.

Or is it possible to get CLLocation to give the page within a UIWebView the gps position without refreshing the page?

Thanks for the help!
itsallgood is offline   Reply With Quote
Old 01-13-2009, 06:32 AM   #2 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default

Hang on...

After a bit more reading on the web -- have i been looking into this too much?!


Could i simply pass the gps position to a UIWebView by calling a javascript function from within the Objective-C???

Using this guide:

WebKit Objective-C Programming Guide: Using JavaScript From Objective-C

or this:

Scripting with JavaScript in Cocoa

Could i have a page on my server, called page.html

with the javascript function:

function hello(gps1,gps2){
alert("hi" + gps1 )
}

then load it in the UIWebView, then in my iphone app call it somehow and pass the gps???


Cheers again for reading!

Last edited by itsallgood; 01-13-2009 at 06:35 AM.
itsallgood is offline   Reply With Quote
Old 01-13-2009, 06:40 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 93
Default

pass the location as a querystring to the url you are displaying...
__________________

iphone and trains in Denmark
mbruun is offline   Reply With Quote
Old 01-13-2009, 06:44 AM   #4 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
Default

Quote:
Originally Posted by mbruun View Post
pass the location as a querystring to the url you are displaying...
Cheers mbruun! Thanks for the reply

I'm really trying not to refresh the page, just update some javascript variables. So they are there when i need them (using ajax)

Would your method be able to just update some javascript variables??? without a page refresh being needed.


Sorry for not testing it myself -- i do not own a mac yet (so cannot use xcode).

I'm going to buy a mac this week if i think i'll be able to make the iphone app i want.

Thanks again
itsallgood is offline   Reply With Quote
Reply

Bookmarks

Tags
cllocation, gps, uiwebview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 246
18 members and 228 guests
ADY, Alsahir, beleg_1998, Dani77, e2applets, iDifferent, iph_s, JamesCahall, JasonR, mer10, Monstertaco, prchn4christ, Promo Dispenser, Robiwan, Rudy, smithdale87, spiderguy84, timle8n1
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,756
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:17 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0