Acceptance of Location tracking app with nsTimer in background in apple market - iphone

I have created this location tracking app, that uses nstimer in background to fetch location every 4 mins.
I am wondering if there will be any problem in submitting the app in the market place..
If you know something regarding it, can you please let me know.
Thanx.

If it's relevant to what your app is doing I don't think it will be a problem.
This is from Apple's App Store Review Guidelines:
4.1 Apps that do not notify and obtain user consent before collecting, transmitting, or using location data will be rejected
4.2 Apps that use location-based APIs for automatic or autonomous control of vehicles, aircraft, or other devices will be rejected
4.3 Apps that use location-based APIs for dispatch, fleet management, or emergency services will be rejected
4.4 Location data can only be used when directly relevant to the features and services provided by the app to the user or to support
approved advertising uses
But pay attention that if you want your app to keep getting location updates even in background, you need to declare this in your plist file, otherwise when the app goes to background you won't be able to get location updates.
Declaring Your App’s Supported Background Tasks
Support for some types of background execution must be declared in
advance by the app that uses them. An app declares support for a
service using its Info.plist file. Add the UIBackgroundModes key to
your Info.plist file and set its value to an array containing one or
location—The app keeps users informed of their location, even while it
is running in the background.

I've gotten one app through. You have to make sure that the user is informed exactly as to what is going on. So dialogs have to be very specific and have a privacy policy in place.
4 minutes is a little bit extreme if that's a permanent state of your app.. I don't think Apple would allow that if they found it during app review. Would it not suffice to just have it updated based on movement? ie. the significant location change api?
The app I did this for used significant location change api for background location tracking and then stepped it up to higher frequency tracking if the app was actually open.

Related

Can we make our own Find My iPhone app

I am thinking to make my own app like Find My iPhone app . But I am confused that whether apple allow developers to have access to play with the security or is there such Apple API's that can help us to include features as in the above app. Any suggestions?
Well I just can't comment because of low reputation. But people must give a reason to down-grade a question. Its quite a valid question.
Creating an app like this is semi possible. Due to the fact that you are not allowed to keep running in the background, except for certain special cases. Such as Music or a guidance app (navigation apps)
Your app can register to receive updates from the GPS location and process them.
The problem is it will use your gps all the time.
The find my iphone app is a combination of wifi location/sim card location/gps location.
It uses a combination of all these items which it has to keep track of your location as close as possible. Now back to your question, the fact that you cannot keep running in the background, will mean the app needs to stay open all the time (open I mean running, not necessarily onscreen). Not like the application from apple itself, which of course is allowed to go outside these developer restrictions.
The APIs exist for you to create the main functionality of this app. Core Location and APNS
When use A is looking for the location of user B, A would tell a server that it needs user B's location.
A push notification could fire up user B's app, at which point...
User B's location services would kick in, in the background,
Send this information to your server
Then update user A with another push notification.

How to receive acceleration-related data from the onboard hardware, when application in background mode?

Am developing application for calculate count of user moved steps and draw the user activities in the map. And we are using UIAccelerometer delegate for receive acceleration-related data from the onboard hardware. So I need to receive acceleration-related data when the application in background mode too. Last time one of my application got rejected because of using location service in background, Apple suggested me like "you can only use this background mode if your app truly needs this information to provide value for the user". Kindly suggest the best approach for this application.
You cannot run accelerometer in background.
You can track user's location in background... however, if you just keep tracking it and do nothing with that info.. apple is going to reject it and tell you to just get the lates location when app comes to foreground.
what you can try is.. update the user of total distance covered etc on a regular basis (like run keeper) and this will justify tracking location in background.
But first, you can try appealing to the review board explaining that you need to track location in background because you show entire route travelled by user when app comes to foregraound. and compare this to existing apps like run keeper and if you are lucky apple may approve your application without any changes...
This can easily be done.
What happens in that iOS put your application in halt state when your application is not in running in foreground state.
You just need to register your application for background execution.
Refer :
http://dcraziee.wordpress.com/2013/05/20/background_ios/
Also refer :
iOS background application network access
for apple policies about using location service.Which states that you can use location service in background.

Is possible to keep Application reporting user location?

I’m developing an application for iPhone that require server to be always aware of the user location. Does iOS have a feature whereby application (or iPhone device) keep reporting it’s location to external server?
Take a look at the "Tracking the User's Location" section in the iOS App Programming Guide. It tells you how to retrieve location data in the background. In this case, you probably only want to get significant updates.
You should be able to use startUpdatingLocation, then do whatever you want (e.g. a POST request) in the delegate.

Is it possible to run application in background forever in iphone?

I know with ios 4 it is possible to run application in background as per this documentation
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
this documents states that if application updates user's current location in background continuously then it is possible to run it in background.but is it necessary that we have to use only CLLocationManager for updating current location?can we user other apis like google latitude apis for updating current location?then also it is possible that application is able to run in the background forever?
As far as I understand from the document you posted, if you define the UIBackgroundModes with a value of location in your info.plist, "the system should allow the application to run as needed in the background". So, the first answer is yes, the application can run in the background and it will run indefinitely (up to battery life). This could be easily checked, actually.
Anyway, it seems to me that this kind of functionality is "reserved" to GPS-like apps and that Apple is really concerned about its usage:
For applications that require more precise location data at regular intervals, such as navigation applications, you need to declare the application as a continuous background application. This option is available for applications that truly need it, but it is the least desirable option because it increases power usage considerably.
so, I understand that Apple will screen really thoroughly all apps that activate this mode in order to assess if they really need the continuous update or do not (and in this case, possibly, the app would not be let in into the App Store).
Now, to answer the second part of your question, I think that one way that Apple will know if your app really complies with the rules, is its usage of CLLocationManager. The risk is that if you use another service, then Apple could think when reviewing your app that you just need background time without needing to constantly update the location.
But this is just a guess...

What can I do inside "location" background thread?

For the sake of this question, assume I plan to build a Google Latitude client app for iOS 4.
my app needs to upload the user gps location every two minutes, and also download the user friends locations. - in the background!
my app can't wait to be woken up by the OS on cellular tower switches (because they may only happen after 2 KM, while my app needs constant gps updating), so I understand I can create a thread, similar to the ones GPS navigators use, to run in the background.
I have no knowledge in iPhone programming, I just need to know if my app is feasible.
Will I be able to access the internet from within the background thread (and upload the user gps location), or is it restricted to only sampling the GPS location.
1.
Will Apple approve such an application, or is this type of use forbidden? because my app isn't realy critical such as a gps navigator
Thanks!
As Don said, iOS will send location events to apps that support it. From there, the app can do what it needs to do with the location event.
Background apps can register for one of three options:
Significant changes only: a low-power way to track location that only wakes the app up when there's a "significant" change in location
Standard location services: compatible with all iOS devices that can use location services, allows you specify change in distance, and works in background. However, if the app has been terminated or suspended, iOS won't attempt to relaunch the app.
Continuous location services: allows the program to receive continuous location updates and iOS will not suspend the application when sent to the background.
More info: Executing Code in the Background and Location Awareness Programming Guide
If you take a look at Executing Code in the Background, Apple provides guidelines on what multitasking-aware apps should and shouldn't do.
You will receive the locationManager:didUpdateToLocation:fromLocation: message in your app. In there, you can do whatever you need to, although you should not update the UI or use Open GL if your are in the background.