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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 09-13-2010, 09:08 PM   #1 (permalink)
New User
 
Join Date: Sep 2010
Location: Terni, italy
Posts: 8
catnic s.r.l. is on a distinguished road
Send a message via Skype™ to catnic s.r.l.
Default Mandatory Location Service enabled

Hello!

I'm writing an app which relies on location services.
I need to emit a warning if the user refuses to enable it and request to enable it again and so on.

How can I accomplish this?
Thx
Massimo
catnic s.r.l. is offline   Reply With Quote
Old 09-13-2010, 09:48 PM   #2 (permalink)
Registered Member
 
kelvinkao's Avatar
 
Join Date: Jul 2009
Location: Los Angeles
Posts: 352
kelvinkao is on a distinguished road
Send a message via AIM to kelvinkao
Default

You can use the locationServicesEnabled method to check if it's enabled. If not, you can alert user about it. If it's not enabled, and you go ahead and call startUpdatingLocation anyway, the user will be prompted to enable it. If the user enables it, good. If the user doesn't enable it, the delegate method should get the didFailWithError message, so you would know.
__________________
My dev blog:
http://www.kelvinkaodev.com
kelvinkao is offline   Reply With Quote
Old 09-14-2010, 04:07 AM   #3 (permalink)
New User
 
Join Date: Sep 2010
Location: Terni, italy
Posts: 8
catnic s.r.l. is on a distinguished road
Send a message via Skype™ to catnic s.r.l.
Default Resume

Each time i do startUpdatingLocation it requests an approval from the user right?
So I can loop this way:

1- startUpdatingLocation
2- handle error on the delegate object doing startUpdatingLocation again and so on

Do you think it's right?
Thx
Massimo



Quote:
Originally Posted by kelvinkao View Post
You can use the locationServicesEnabled method to check if it's enabled. If not, you can alert user about it. If it's not enabled, and you go ahead and call startUpdatingLocation anyway, the user will be prompted to enable it. If the user enables it, good. If the user doesn't enable it, the delegate method should get the didFailWithError message, so you would know.
catnic s.r.l. is offline   Reply With Quote
Reply

Bookmarks

Tags
enable, location based service

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: 330
14 members and 316 guests
Absentia, cgokey, fiftysixty, givensur, heshiming, iGamesDev, linkmx, michaelhansen, mraalex, PixelInteractive, raihan.zbr, Sloshmonster, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,117
Posts: 402,890
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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