Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geofence iOS8 : Require Background Mode for iOS Geofencing [closed]

I have used geofencing in my app.

Geofence feature discription:

App has two type of functionality while entering or exiting from the region:

  1. Reset fence: If user will enter in the region and that region has the functionality of reset fence then app will call one web-service and get the new fence list. This functionality is also should work in background mode.

  2. App Open: If user will enter in the region and that region has the functionality of app_open then app will

     *a. Show alert, if the app is in foreground mode*
     *b. Show notification, if the app is in background mode*
    

I have used region monitoring for achieving this functionality and also do not want to use significant location change because the app set up fences about 100 to 200 meter radius.

Now my problem is that,

  1. Should i use background mode "App registers for location updates" for monitoring region crossing
  2. I have used below code for calling web-service of 'reset fence' in background mode.

    -(void) beginBackgroundUpdateTask { self.backgroundUpdateTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ [self endBackgroundUpdateTask]; }]; }

    -(void) endBackgroundUpdateTask { [[UIApplication sharedApplication] endBackgroundTask: self.backgroundUpdateTask]; self.backgroundUpdateTask = UIBackgroundTaskInvalid; }

So, Should i apply any setting in info.plist due to [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandle.

Please guide me further. I have searched lots over internet but still not found any specific answer of my above two questions.

Note: The app is already rejected by apple due to background mode 'Location updates'. Please suggest me the way so apple will not reject the app.

Below is the reason.

2.16: Multitasking Apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc. ----- 2.16 ----- We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines. We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location. It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the "location" setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.

Lots of thanks in advance.

like image 242
Nikh1414 Avatar asked Sep 30 '14 10:09

Nikh1414


Video Answer


1 Answers

Our app was rejected for the same reason. If all you are doing is region monitoring, you don't need the location updates background mode. We turned it off and our region monitoring works as desired. Even if the app is not running, it is launched by iOS when the user enters the region. We resubmitted the app and it was approved.

like image 134
Mike Taverne Avatar answered Oct 27 '22 00:10

Mike Taverne