Send notifications based on user location

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.

+7
source share
1 answer

How about "Path 1.5" (combination of 1 and 2)?

You can capture the user's location and send it to the service. He will respond with a notification using a wide range (for example, throughout the city). The application will show a notification only for the actual range.

But the application knows notifications for a wide range, therefore, if users move, the application can display a new notification (in a wide range) without connecting to the service.

Some additional thoughts:

  • If the user goes out of a wide range, the application can automatically connect to your service again to request a new batch of notifications.
  • You can configure a wide range, so the user may prefer a lot of communication or a wider range.
  • Depending on the user's speed (for example, if he is in the car or on foot), you can configure a wide range of notifications.
+5
source

All Articles