Using location based push notifications on iOS

user1498477 picture user1498477 · Mar 20, 2013 · Viewed 17.2k times · Source

I am looking on developing a tourist application for a city, where when the user is near to a "place of interest" he could get a push (local) on his device.

For example, I would add 100 POIs on my app, and a 100 messages for every POI to show when the user is in range, e.g. "You are close to the Cathedral of.."

Is this scenario possible? Is it possible to check the users position e.g. every 10 minutes even when the application is killed, and when in range fire a local push? How much battery would it drain? If the user closes the GPS would it try to use 3G/wifi signal to get the position?

If yes could you guide me the right way on what I should read on the subject maybe some tutorials and articles?

Answer

dlouwers picture dlouwers · Aug 14, 2013

that's indeed possible. You could use the aforementioned technique outlined in this post. You can extend this with using CLLocationManager:: startMonitoringSignificantLocationChanges to restart the process of listening to locations after the app has been killed. Depending on your accuracy needs there are many other optimizations that can be done regarding battery life, like checking more frequently when a user speeds up etc.

I have developed a library that handles these details for you (for both Android and iOS). The download includes an example application that demonstrates how to use it. Feel free to check it out.