Oops! Something went wrong while submitting the form.
Location based notifications are the next big thing. Currently, marketers can target mobile users based on their IP address location, GPS location, and more. Location-based marketing is still in its infancy, but the technology is developing quickly.
How it Works
At the heart of Location Triggered Notifications are geofences. A geofence is a virtual fence that’s placed around a real-world location. They can range in size from very small (encircling a store) to very large (covering an entire city). Most often, geofences are placed around specific buildings or other points of interest.
GeoSpark supports unlimited geofences and you can also use our APIs to quickly upload locations. Once you’ve added at least one geofence to GeoSpark, you can start building location-based mobile marketing campaigns.
In this post, we will see how GeoSpark and Firebase come together to deliver this.
Building a Location Triggered Notifications with GeoSpark is Easy
We would need a mobile application which has GeoSpark SDK integrated with it and can receive the location based notifications. This application uses the Firebase and GeoSpark Android SDKs. More specifically, this is what the location triggered notifications flow in the application looks like:
User logs in to the application, using Firebase Authentication.
On successful authentication, application gets or creates a user object on GeoSpark.
Geofences are created using GeoSpark Dashboard or API.
Campaigns are created in Firebase and stored in Firebase Realtime Database with Geofence Id.
The application starts tracking with GeoSpark, and triggers an event whenever the user enters or exits a geofence. The events are sent to the your firebase webhook url.
The Firebase receives the event and then fetches the campaign details from Firebase Realtime Database.
Finally notification is sent the customer application using the Firebase Cloud Messaging.
Implementing a location based notification involves a consumer app (which is being tracked) and the server. The example implementation uses GeoSpark Android SDK to illustrate a common implementation.
Let’s look at how these components are integrated, starting with creating a project in Firebase.
2. Login with a google account or create an account to login if you don’t have one.
3. Go to console.
4. Add project, give it a name and click on CREATE PROJECT
Once you have created the project, you will be directed to the firebase console.
Next process; We should click the “Add Firebase to your Android App” and we enter the project package name. Google account login process needs to SHA1. We have to add SHA1 our project. After that, we should download google-services.json file and which has to be added into your project app folder. Finally, we should select Authentication on left side and we have to activate Email/Password and Google section.
Create a Firebase Realtime Database.
Create database in test mode that anyone with your database reference will be able to read or write to your database
"gtitle": "GeoSpark HQ",
"gmessage": "Welcome to GeoSpark HQ, GeoSpark is an AI driven location tracking platform with 90% less battery drain for your iOS and Android Apps."
This will create geofences in your Firebase Realtime Database linking the geofence_id from GeoSpark.
Add your webhook url from firebase to application settings in GeoSpark Dashboard.
🎉 Congratulations, you have created a geofence and enabled webhook integrations.
When any of the users enter the geofence, they will receive the geofence message as notification.
This blog post contains only the example application using android and firebase where the users are authenticated via firebase and then updated into firebase realtime database along with Geospark user id for future identification. The addgeofence endpoint is to update geofences into firebase realtime database along with geofence id from GeoSpark.
You can make use of below products from GeoSpark to build similar application or integrate GeoSpark into your existing application.
GeoSpark SDK for iOS and Android
Try us out
How have you built your tracking experience with GeoSpark? We are always looking to improve ours and would love to hear from you. We offer our tracking experience through a quick integration experience to developers. There are open-source example application in our Github page.