Randy7611273
Posts: 0
Joined: Sat Jun 27, 2015 7:03 pm

Cordova Geolocation Plugin running in background. How to disable?

My app was just rejected by Apple for using background location services. When the app first launches, an alert appears saying "Allow to access your location even when you are not using the app?" I am using Geolocation 1.0.1 (Cordova Geolocation Plugin). I have not customized Geolocation. How can I make Apple happy, and only use Geolocation when the app is in the foreground, as intended?

Randy7611273
Posts: 0
Joined: Sat Jun 27, 2015 7:03 pm

Cordova Geolocation Plugin running in background. How to disable?

No UIBackgroundModes are being selected:

Image

I have made no modifications to the Geolocation services.
Image

I am simply invoking the Geolocation service when a certain page loads to determine the location of the client relative to an event list.

Randy7611273
Posts: 0
Joined: Sat Jun 27, 2015 7:03 pm

Cordova Geolocation Plugin running in background. How to disable?

The problem appears to be with the Geolocation service. I deleted and re-entered the service itself, and yet the problem remains. However, when I disable the service under App Settings Cordova plugins Geolocation, and still invoke the Geolocation service call, I get the following:

Image
Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Cordova Geolocation Plugin running in background. How to disable?

Hi Randy -

Could you explain in more detail how exactly you're invoking Geolocation service in your app and what event you're using?

Randy7611273
Posts: 0
Joined: Sat Jun 27, 2015 7:03 pm

Cordova Geolocation Plugin running in background. How to disable?

Event: Page Show
Invoke Service: Datasource: geolocation

Before send: No mapping
Success: Service response: latitude and longitude to Storage, lat and long respectively

Randy7611273
Posts: 0
Joined: Sat Jun 27, 2015 7:03 pm

Cordova Geolocation Plugin running in background. How to disable?

I could be mistaken, but this seems to be a known issue:

https://getsatisfaction.com/apperyio/...

Is it possibly related to the (old?) version of Cordova Geolocation Plugin 1.0.1?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Cordova Geolocation Plugin running in background. How to disable?

Hi Randy -

Run your Geolocation service initialization on the Device Ready event, not on the Page show event.

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Cordova Geolocation Plugin running in background. How to disable?

Hi,

I have the same exact problem when testing my app.

I changed the Geolocation service initialization to on the Device Ready event, instead of on the Page show event but still problem not fixed!!

I'm still getting an alert when the app first launches saying "Allow to access your location even when you are not using the app" which could cause Apple to reject my app

Any firm solution for this ???

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Cordova Geolocation Plugin running in background. How to disable?

This a standard behavior for current Cordova plugins running on the latest iOS versions. If you want to change the alert message that you are getting initially, you can use our solution here: https://docs.appery.io/docs/known-iss...

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Cordova Geolocation Plugin running in background. How to disable?

Hi IIIya,

Thanks for the quick reply

As per Appery workaround solution I should delete the below line from the app.Info.plist under the Source tab in the builder .Please confirm ..

-------------

NSLocationAlwaysUsageDescription
Your location information will be used by this app. Choose "Allow" so the app can provide location services.

-----------------

One more thing ,do you recommend to delete it in Appery builder or shall I delete it within the Xcode after exporting as I will be able to do that as well

Return to “Issues”