I used a geo lens in my application.
Geofence Feature Description:
The application has two types of functions when entering or leaving a region:
Reset fence: If a user enters a region and the reset fence is functioning in this region, the application will call one web service and receive a new fence list. This functionality should also work in the background.
The application is open: If the user enters a region, and this region will have the functions app_open, then the application will
*a. Show alert, if the app is in foreground mode* *b. Show notification, if the app is in background mode*
I used area monitoring to achieve this functionality, and also do not want to use a significant change in location, because the application sets up fences about a radius of 100-200 m.
Now my problem is that
- Should I use the background "Application Registers for location updates" to control the intersection of the area.
I used the code below to call the "reset fence" web service in the background.
- (void) beginBackgroundUpdateTask {self.backgroundUpdateTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^ {[self endBackgroundUpdateTask]; }]; }
- (void) endBackgroundUpdateTask {[[[UAppication sharedApplication] endBackgroundTask: self.backgroundUpdateTask]; self.backgroundUpdateTask = UIBackgroundTaskInvalid; }
So, I have to apply any settings in info.plist because of [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandle.
I ask you to continue. I searched a lot over the Internet, but still have not found an answer to my two questions.
Note. The application has already been rejected by Apple due to the background location updates. Please suggest me a way so that the apple does not reject the application.
Below is the reason.
2.16: Multitasking applications can only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc. ----- 2.16 ----- We found that your application uses the background mode, but does not include functionality that requires constant mode launch. This behavior does not comply with the App Store Review Guide. We noticed that your application announces location support in the UIBackgroundModes key in your Info.plist, but does not include features that require a permanent location. It would be appropriate to add features that require constant use of real-time location updates when the application is in the background, or remove the "location" setting from the UIBackgroundModes key. If your application does not require constant real-time location updates, we recommend that you use the location service with a significant change or the location service of the region.
Thank you very much in advance.
source share