In my Android application that I am developing, I would like to be able to send notifications to the user's phone depending on their location. For example, a user receives notifications for special deals in restaurants that are local to their current location.
I would like to know the best way to do this? (It has no code, just a general structure for how to do this).
I thought of two possible ways:
Method 1:
1) Ask the application to get the user's location and report it to the server every 5 minutes. 2) If the user is within the established radius of the location, send them a notification.
Method 2:
1) Send notifications and use the / s method of the broadcast application receiver to filter and show only to users in the correct areas.
Both seem terribly inefficient, since 1 depends on the constantly running service and the method of sending notifications to all users of the application, and since notifications will be very specific to a particular area, almost 100% of the notification time will not be (and therefore not shown).
I already wrote the GCM code, and I can also get the location of users, I just need a way to link them.
I hope I put my question clear.
user1804590
source share