ioscore-locationbackground-processbackground-mode

Is using Core Location for performing functionality in the background appropriate?


Lately, I've notice that there are a few applications request to access the user's location for performing some functionalities in the background.

For example: Application for scanning and uploading the user's photos for backup purposes, so when entering the background state, it keeps scanning and uploading.

What am I asking:

Also, I've read (and this is what I assume) that using the core location for not what is meant should causes to let the application to be rejected, the weird thing that -as I mentioned- there are a few applications doing this! I feel a little confused about it.


Solution

  • Also, I've read (and this is what I assume) that using the core location for not what is meant should causes to let the application to be rejected, the weird thing that -as I mentioned- there are a few applications doing this! I feel a little confused about it.

    You are right to be in doubt. Do not imitate this behavior. These people are misusing CoreLocation as a way of getting their code to run in the background even though they are not really using any CoreLocation features.

    You are not allowed to do things arbitrarily in the background — and with good reason. Don't violate the rules. If you want to keep uploading even when in the background, use a URLSession with a background URLSessionConfiguration. Do things the right way.