Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
782 views
in Technique[技术] by (71.8m points)

ios - 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:

  • If there are Background Execution mechanisms for executing Background Tasks (Select Target -> Capabilities -> Background Modes), so why using the Core Location for doing such a thing?

  • If using Core Location is different, what is the benefit of using it?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...