iOS: "This application needs location services / Allow / Don't Allow" alert
iOS: "This application needs location services / Allow / Don't Allow" alert
- Subject: iOS: "This application needs location services / Allow / Don't Allow" alert
- From: John Michael Zorko <email@hidden>
- Date: Wed, 01 Feb 2012 00:09:44 -0800
Hello, all ...
I've an issue that i'm trying to solve, and i've run into several walls. This app i'm working on requires Core Location, and on first install, iOS displays it's "this app needs location services / Allow / Don't Allow" alert. That's fine, but the issue is that my app's window's root view controller's viewDidLoad is called before the iOS-supplied alert is dismissed, and said viewDidLoad checks to see if CL is enabled and shows it's own alert if not. The result: once the user dismisses the iOS-supplied alert by tapping Allow, the alert that my view controller created is shown (because when my view controller did the CL check, the user hadn't dismissed the iOS-supplied alert yet, so CL was not enabled at the time).
I've tried viewWillAppear, viewDidAppear, becomeFirstResponder, canBecomeFirstResponder, even a few nasty hacks that I really would rather not do if I can possibly help it. Nothing has worked so far. Other apps seem to solve this problem by having the next CL check happen after a user action. I would prefer not to make the user tap something on the screen after dismissing the iOS-supplied alert, but I don't see any other way since I don't see any notification that my app gets once the iOS-supplied "this app needs location services / Allow / Don't Allow" is dismissed by the user.
This app requires location services -- the client does not want the app to perform it's function if it detects that it's somewhere it's not supposed to be. Is it possible for the app to somehow detect when the iOS-supplied alert has been dismissed, so it can do it's CL check in case the user tapped "Don't Allow"?
Regards,
John
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden