I want to integrate a public chatroom within my app however I am clueless as how to create the backend.
I use firebase for my app and the setup is simple between two users or a group of users. I create a private room based on a reference point in Firebase which allows the users in that group to access the messages.
Now lets say I am in LA, I want users to be able to chat with other users that are within a 1 mile radius from their location (lat/lng). I know its possible as there is an app that does this which can be found at https://itunes.apple.com/sg/app/popcorn-messaging/id718416705?mt=8.
Only read the following if you want to know what I've tried. It may be a bit confusing.
One way I thought about doing this is creating a chatroom throughout the world with a mile spacing. For example, start with lat:0, lng:0 and then move a mile to the right, then another mile to the right, etc. however that does more harm than good. I will have millions of chatrooms and not all used.
Second way I thought I can implement is create a chatroom if it doesn't exists within a users radius. So if I'm in LA, and there are no chatrooms, it would create one at that location and lets say if another person goes to LA because a chatroom was already created within a 1 mile location, it will load the chatroom for that user.
Any suggestions will be greatly appreciated.