Chat room MobileApp direction


So, I’m trying to create a mobile app, Apple/Android using GPS location to enter anonymous localized chatrooms. I don’t really know where to start though (XCode, OF, templates etc.)
Any ideas?
I’m not a coding expert, so idk how advanced I can get, but I do have a pretty basic understanding on what I’m getting myself into.



is this supposed to be like Firechat? How are you planning on handling the messaging? do you have a server that will handle the push notifications? If you are making it for iOS then yes xcode is the way you want to go, if you want to do android either eclipse or android studio is what you need to work with.

You say you are not a coding expert but have you worked with java or objective-c/swift before? I have built a messaging application for both platforms and there are certainly easy and hard ways of going about things.


Depending on how you do this, it seems like this could be a webapp … I don’t think you would even need xcode/ios, etc. You can get GPS location from the user’s browser and make connections on the back end.

If I were going to make this app from scratch (which probably isn’t a good idea, because I’m sure you could find some existing components), I would probably make it using node.js. @porejud @brannondorsey @notandrewkaye correct me if I’m wrong – but this might be possible with a very simple front ( style) end and less than 100 lines of node.js server code … no? Basically it’s the chat server example, except you are connecting people based on geographical proximity …


@dominic_a_amato I didn’t know about Firechat, but yes, something very similar, as a mobile app for the mobile device. The chatrooms would be located based on GPS location, not online location. (You can only enter the room, if you are in GPS region)
Ideally it is all anonymous, so no signing in with twitter, or other social media account. As you join room, you create a nickname. Messaging would be based on server, however, messages will delete at 5MB (or so) limit.
I have just worked with Processing, and HTML/CSS. (So I will be watching a ton of tutorials)

@bakercp ideally it would be an app downloaded to the users mobile device to create a more immersive experience, but maybe a webapp would be a good place to start? How would you go about starting a webapp? Is that server example you are talking about on node.js

Thanks a ton for the quick responses!


I can tell you now you are diving into the deep end if you intend to write native apps without any APIs. Its doable but without more background I would warn you that the learning curve is harsh. Swift is still brand new so the amount of resources online is dwarfed by the amount for objective-c but objective-c is just a syntactical headache and I’d advise against putting in the time to learn in.

If you’re unfamiliar with closures or block statements the http request system in iOS can be incredibly confusing and if you have never touched multithreading then its easy to make mistakes because the new request systems is completely asynchronous.

You should probably check out something like firebase, titanium, or xamarin or something of that ilk because a lot of the most awful parts (did I mention multithreading) are covered by API’s.

I don’t know how much you have looked into this app but I can give you some useful advice on places to start. Learn the haversine formula, if you want to do anything with location based services its a must. I know you said anonymous but make sure to tack on a persistent user ID or your messages will just fly everywhere. Consider your users data usage as well, learn how apple and android handle push notifications. Any messaging app that doesn’t implement a BOSH protocol can either consistently ping the server for new messages or use push notifications and you can probably guess which one is easier on everyone.

That being said, @bakercp’s suggestion might actually be the better way to go about it, a lot of apps you use on your phone are actually just containers for webapps. Its a lot cheaper and quicker than native development.


I’m not exactly sure what you mean by “immersive”, but if the feeling of a native app experience (as opposed to a full-screen web-browser or something), you should check out and / or (they’re essentially the same’s-in-a-name/). They allow you to easily make apps with web tools (i.e. with javascript, css, html, etc) and that would connect to a server (say, node.js)

Basically I was able to get native apps running on Android and IOS in just a couple minutes when I tried it out a few months ago. It was quite amazing. and such are super cool, but probably not necessary. I suggest that you start with something like this:

Then, as a part of your initial client connection process, the client will send you their location.

Then on the server you’ll have a giant list of people and their GPS locations (I’m optimistic that you will have a giant list of people :)).

Then each time someone sends a message, you will distribute that message not to everyone in the chat (like the primary example above), but only to people within a certain geographical radius of the sender. To calculate the distance between the sender and the recipient you can indeed use the haversine formula mentioned by @dominic_a_amato. If you are using the node.js back end, this is super easy to calculate gps distance in javascript using this tutorial

So, my advice to you is to get a simple node.js chat service running like the one in the tutorial above. This will give you a web-based chat services. Then you can modify the client code to send the GPS location using the browser’s geolocation api ( and you can modify the server to only distribute messages sent by users to other connected user that are within a reasonable distance (as calculated by the haversine formula).

Then once you get all of that working really well, you could take the whole thing into the native app experience really trivially (i.e. with no code major changes to your web client!) by using Cordova/PhoneGap.


@dominic_a_amato @bakercp
This is exactly what I needed, thank you so much for your help!
I will keep updated with the project


High five. Looking forward to seeing what you make!


Prior to technical issues, where is the cut off for “local”? Let’s say I am sitting in MacLean Center. Another person is sitting in a building in the North Loop. Someone else is sitting in the South Loop. Given a radius, I am in North Loop’s chat and in South Loops chat, but North Loop Person and South Loop person are not in each other’s chat. Do I see both of them but they do not see one another? Is this individual or group chat? You say chat ROOM so I assume it is not private chat so how do you decide where the “room” stops? Even if it stops at a specific [distance from GPS] point, you have overlap between every person in every location unless you map the (globe? map?) with specific GPS quads. You may have some further specs you left out, e.g. this is related to a limited set of locations so you are either in or out of a location. As it’s described though, every point is close enough to any other point that the entire world is in a chat together, poetic, but not what I think you intend.


I love the idea of the person in the “middle” seeing chats from both north and south but north and south not seeing each other.

I also like the idea of people acting as switches / routers. Say someone in Chicago wanted to get a message to someone in Saint Louis … cut and paste to find the shortest possible route …



… I think it just excites that localized utopian mesh network-loving part of my brain.


@atrowbridge ideally the chatrooms would be based on predetermined centered locations in a database(or something?) with about a 20-50m radius (depending on the location). Then when the client’s GPS location is located within the registered region, they have access to the chat room.

Say for instance, bars/clubs. Big enough for people to navigate within, but not so big that people at neighboring locations will have access to. (I imagine this will be tough at first, I’m guessing early versions will have a crossover of accessible chatrooms)


andI’m guessing the database storing this information will be connected to Google Maps


You could also create polygon GPS boundaries and easily test to see if someone’s GPS coordinate is inside.


Point in polygon test:


There are probably a few tricks to doing point in poly tests with GPS coordinates (spherical coordinates vs. cartesian coordinates), but it would probably be close enough especially considering that GPS isn’t super accurate anyway. If you wanted to get fancy you could convert GPS to Cartesian using the standard UTM conversion / projection … but that is starting to get out of control :smile:


Oh and yeah you could create your geo-fences using a google maps interface. Ask @monks about his Where At? project