Remove Location Manager alert from my application - iphone

I used Location Manager API for find out Latitude and Longitude of the current place.
But when i called update location manager method i get some alert from application which i have attach along this message.
I want to remove this alert message and by default i want to set YES or (Allow) for that.
Is it possible or not?
Thank You

Its not possible to do that. It is done to safeguard user's security. If you've been following the PATH ADDRESSBOOK issues, it was raised 'coz Path App didn't ask users before using their Address Book. So Apple's implemented the asking feature or permission by default in Core Location and Push Notifications. And By the looks of it, in the address book as well and you will have to stick to it - After all, you don't want to fall into privacy issues. :)

It is not possible,This dialog would be shown once when the app starts

You cannot and even if you could, probably your App wouldn't be accepted by Apple.

Related

How to Share GPS Location iOS

I have seen some apps that offer functionality to share location via email or SMS. I have done a good amount of searching and haven't found much regarding this. Is it because all that is shared are the longitude, latitude information (thus being very simple)?
You need to grab location information and use a transportation medium (email, TCP/IP, HTTP) to send it to a remote site. There is no automatic way of sharing that.
For this you have to fetch Current location of user with the help of core location and with the help of this latitude longitude you can share a google map link to other user via facebook, gmail or any social media.
You need to use CLLocationManager to subscribe for location updates. They are happening asynchronously and every second. You may control precision and some other parameters. Once you get it, you need to push a notification to another device thru your service or something like Urban Airship. I build my app like that https://itunes.apple.com/us/app/citrus-location/id777381230?ls=1&mt=8.
Here is more info from Apple: https://developer.apple.com/library/ios/documentation/userexperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html

is there an API call that gives you an iPhone user's "My Info" contact DB record?

So in the latest iOS (not sure about prior) there is a "My Info" setting that let's the user pick a ContactDB record on his device that is "his".
Is there an API call to get this value? I can query the user's entire ContactDB, but figuring out which contact DB is his isn't trivial.
There’s no public API that I know of to retrieve the user’s “me” card. Your best option is probably to present an ABPeoplePickerNavigationController asking the user to select it.
Also, I believe Bump had a setup step that asked for your contact info, and the moment you gave it your phone number (or email?) it looked up the contact card with the matching info and autofilled the rest of the form. A bit of a workaround, but it did the trick.

Managing absence of current location

I am new to the objective C programming and I am in a position where I need to create an iPhone App really quickly. I am using XCode 4.2
I have found a method to get the user country (using NSLocale)
I assume that the application will ask the user if he wants to use his/her current location for that?
if the user says "don t allow" how can we manage that , what are the functions that can be used ?
Thanks
The Core Location methods automatically handles user permission, if that's what you're asking. If the user says he doesn't want his location to be used, well, handle it the way you want : display an error message, of it is crucial to your app, display an alert saying how location is crucial to your app, and exit it. Or something else, it's up to you.
You can check if the location services are enabled system-wise with [CLLocationManager locationServicesEnabled]. For your app only, when getting the location fails, the - locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error message is sent to the location managed delegate. You can check the error domain/code to have more details

How to obtain ongoing user consent for use of location info

In my application, I'm using location information to capture the user locations.
I have the following questions:
What are the alert messages we have to provide in the application for user to show that we are going to use their location?
Can we fetch the location info in the background once the user accept that?
If user is allowed to fetch the location information let's say in the first time the application launches, do we need to provide the alerts for consecutive fetches (in next app loads)?
Thank you.
None, iOS will do this automatically.
This is the normal procedure.
iOS will bug the user as it is programmed to do.
If you assign the purpose property to your location manager instance, it will include that in the popup that asks the user for permission. See http://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125-CH3-SW30
Yes for the other two.
I'm not an iPhone programmer, but I'm an iPhone user. Every time an application has asked for access to my location information, once I say yes it never asks again and regularly uses it.
This leads me to believe that the answer to your questions is:
1) Probably the alert message is provided automatically the first time your application requests location information. I'm pretty sure they aren't relying on developers policing themselves.
2) Yes, I believe so.
3) Yes, I believe so.

iPhone Objective-C: Ensure user allows location sharing before doing other actions

My application asks for location at the log in screen, and right now, the user can log in without sharing his or her location. When the user selects "No" for sharing location, an error that reads Error Domain=kCLErrorDomainCode=1 "The operation couldn't be completed. (kCLErrorDomain error 1.)" is thrown. I'm guessing that's because I am trying to access latitude and longitude without having such things.
My question is, how do I make sure that a user allows location before anything else can be done? Is there a way to create a new "Allow Location" pop-up request?
Thanks in advance!
You would need to implement locationManager:didFailWithError.
The documentation states that:
If the user denies your application’s
use of the location service, this
method reports a kCLErrorDenied
error. Upon receiving such an error,
you should stop the location service.
Additional information is here
My suggestion would be have your application cope with the situation where no location information is available, by informing the user that this is a requirement etc.
Repeating the dialog until you get the answer you want is just going to annoy the user.