Notify a user about a close region based on his speed

58 Views Asked by At

I'm building an app that notifies the user whenever he approaches one of my client's stores.

I want that the app will notify the user based on his speed (30km/h+ - 500m before, 15-24km/h - 200m before, 14km/h- - 70m before).

Currently, the CLCircularRegion object's radius is set to 200 and I want it to be changed based on the speed as I mentioned.

I hope you understand what I mean, if not, write in the comments your questions and I'll explain.

Does anyone have an idea how can I do this?

Thanks!

1

There are 1 best solutions below

5
On

You can't do this in the background because you can't change the monitored regions from there. It's probably possible to set the range to the maximum and then when the app receives an update determine the current speed and decide wether to notify the user or not, but that isn't going to be simple. So, there isn't a good solution for background usage other than to ask the user what they want and set it in advance.

If you're app is in the foreground then you can monitor location changes and update the monitored regions at any time you want based on the speed.