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 05-31-2011, 06:58 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 5
yadit is on a distinguished road
Default How to stop location services when the app is in background?

Hi, In my app I load some sites in UIWebView. Some of these sites use location services.

My problem is, that while viewing one of these sites, when the app goes to background, the location services are still on. Since my app didn't turn them on - I don't know what to do.

The current solution I have is loading a blank page when going to background, then loading the original site back when moving to foreground. It works, but the blank page is visible to the user, when viewing the app - which isn't very good.

Does anyone have other ideas?
yadit is offline   Reply With Quote
Old 05-31-2011, 07:08 AM   #2 (permalink)
Registered Member
 
djalfirevic's Avatar
 
Join Date: Mar 2011
Posts: 84
djalfirevic is on a distinguished road
Default

Do you have a location manager in your app? Tried this?

Code:
- (void) applicationDidEnterBackground:(UIApplication *)application {   
  [locationManager stopUpdatingLocation];
}
Quote:
Originally Posted by yadit View Post
Hi, In my app I load some sites in UIWebView. Some of these sites use location services.

My problem is, that while viewing one of these sites, when the app goes to background, the location services are still on. Since my app didn't turn them on - I don't know what to do.

The current solution I have is loading a blank page when going to background, then loading the original site back when moving to foreground. It works, but the blank page is visible to the user, when viewing the app - which isn't very good.

Does anyone have other ideas?
__________________
And thus I clothe my naked villainy; with old odd ends stolen forth from holy writ; and seem a saint when most I play the devil.
djalfirevic is offline   Reply With Quote
Old 05-31-2011, 07:19 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 5
yadit is on a distinguished road
Default

Tried that.
Since my app isn't the one actually activating the location services, I couldn't turn them off like that.
By the way, Safari is doing exactly what I want to do. Too bad I'm not Apple...
yadit is offline   Reply With Quote
Reply

Bookmarks

Tags
background, iphone, location services, webview

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: 334
6 members and 328 guests
Dnnake, dre, iOS.Lover, jenniead38, Kirkout, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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