Build a live location sharing app

In this tutorial, you’ll discover how to build a geolocation tracking app that allows users to share locations and send messages in real-time, as well as integrate with ChatGPT to provide information about your location.

See live location sharing in action

Share your location on the map in the demo, or clone the app and run it with your own keys

Demo

Geolocation Tracking

Share your location with everyone in a session and see them all on one map in real time. A PubNub JavaScript demo built with messages, Presence, and App Context.

GitHub

PubNubDevelopers/Geolocation-Demo

The complete source. Put your publish and subscribe keys in js/app.js, then serve the folder on localhost, for example with npx serve.

git clone https://github.com/PubNubDevelopers/Geolocation-Demo.git
View on Github

About this tutorial

You will develop a geolocation tracking application that allows participants to locate and interact with each other, based on PubNub's Javascript SDK.

  • Real-time Tracking - Share your location with others in real-time
  • Location History - See the last known update from any user that's come online
  • Greeting Messages - Send and update a personal message for users looking for you
  • Private Session and Invites - Make a new private channel for you and others
  • ChatGPT Integration - Information about your location powered by PubNub and ChatGPT