How to obtain ongoing user consent for use of location info - iphone

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.

Related

Remove Location Manager alert from my application

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.

Is it possible to save a custom variable for each user on their account?

I just got starte with programming a Facebook app. I already wrote an app for the VZ-Network, and there they have something called 'Persistant Storage'. Basically its an environment where you can save custom data on each user account. With your app you can read this data from the current user as well as from the users friends. Now I want to port my app to Facebook and my problem is that I didn't find such functionality here yet.
For now I would like to finish and launch this as soon as possible, so it would be nice if I could c&p as much of the code as possible.
Since the data is contains information about participation, at some point I would like to use the Facebook event object. But I was wondering if that could cause problems since it would require to create those events publically in order to use them in my app. Couldn't that lead to legal problems when I create such events with those who actually host the events in the real world? Would I have to ask the hosts to create those events, could I automate this process, or in case they don't have a Facebook account ask them to approve that the app creates the event for them?
I also need to know in what events the users friends participate, so I can't simply save the information on my server, since I don't have the friend info there.
In any case, it seems much easier to me to simply use a list of EventIDs on each user account to check whether or not the user participates in an event.

Ask iOS to execute an app or services periodically

I'd like to have a game in which everytime one of your friends beats your highscore, it sends you a notification.
There is many ways to do it. But I would like to know if there is a way to "ask" your iphone to call one of your applications or services which then contains the code that checks the leaderboards and push a notification if needed.
Not sure if this is clear enough ;p
Thank you for your help
If you want to try something like this..then you must do this from within the app. .that is system won't tell your app to check codes.. you open the app and then press a button or something to check leader boards.
So there is no way to ask your iPhone!
best way is to have an option in within the app through which user confirms that he wants to receive notifications on high score beaten..then you keep his high score on your server..and if someone breaks that.. post a notification from your server.
Your highest score must be stored somewhere. If you store it on your server, then you can use web services so that every time the user got a highest mark(on his/her iPhone), send a web service request to the server and get the results back.
On the server side, all you have to care is creating a user's friend list and the highest score of every player.
Hope this helps.

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

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.