Using location based push notifications on iOS
Asked Answered
L

4

8

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?

Longerich answered 20/3, 2013 at 18:35 Comment(0)
P
5

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.

Pettish answered 14/8, 2013 at 15:7 Comment(0)
T
2

Yes,that is possible.you need to have some "places" (co-ordinates or addresses) stored on theapp locally. Proximity to a stored "place" can be checked by Reverse geocoder.

Check this Wonderful SO Question , very similar to yours

Thalassic answered 20/3, 2013 at 18:40 Comment(1)
But can this be checked when the application is killed(not in background). How much battery would it drain? If the user closes the GPS would it try to use 3G/wifi signal to get the position?Longerich
A
2

This might be too late for your question, but for anyone else that needs it. GeoFencing is a good option.

Here is a video explaining what geofencing is http://academy.pulsatehq.com/7-things-about-geofencing

And if you are using Ionic platform, here is the link to the plugin https://github.com/cowbell/cordova-plugin-geofence

GeoFencing will solve exactly your problem. Just create a bunch of geofence located at these tourist sites and when user enters within certain radius of these locations, user will get a notification.

Good luck

Automat answered 7/5, 2016 at 20:59 Comment(0)
I
0

When the app is killed, what exactly would be receiving the location updates?

When in the background though, you can set up location updates based on both proximity and time.

Check How do I get a background location update every n minutes in my iOS application?

As for GPS vs. 3g/wifi, the user has the ability to either allow location services for an app, or not. iOS will then handle whether GPS or cell signal will be used to determine position. Read about the significant-change location service here. Using the significant-change service will use more cell location than GPS lock to determine position, and vice-versa for the standard location service. Also look at location accuracy to learn more about conserving battery.

Initiative answered 20/3, 2013 at 19:3 Comment(1)
But in the same way how do you build an alarm app? Even when the app is killed , if the time is the predefined time the local push will be fired right? I thought maybe you could do smth like this with the gps too.Longerich

© 2022 - 2024 — McMap. All rights reserved.