ios - Public chatroom with radius using Firebase (Suggestions Requested) -


i want integrate public chatroom within app clueless how create backend.

i use firebase app , setup simple between 2 users or group of users. create private room based on reference point in firebase allows users in group access messages.

now lets in la, want users able chat other users within 1 mile radius location (lat/lng). know possible there app can found @ https://itunes.apple.com/sg/app/popcorn-messaging/id718416705?mt=8.

only read following if want know i've tried. may bit confusing.

one way thought doing creating chatroom throughout world mile spacing. example, start lat:0, lng:0 , move mile right, mile right, etc. more harm good. have millions of chatrooms , not used.

second way thought can implement create chatroom if doesn't exists within users radius. if i'm in la, , there no chatrooms, create 1 @ location , lets if person goes la because chatroom created within 1 mile location, load chatroom user.

any suggestions appreciated.

if you're sure want 1 mile 1 mile or type of set distance, think predefined chat rooms throughout world mile spacing better option. simpler far adding new users , avoiding overlaps when people move locations. if you're using firebase, , flatten data correctly, won't hurt having empty rooms.

the reason might not if you're worried chat rooms becoming full or empty. i'm not sure if concern application, drawback of having predefined locations. then, use predefined locations , scale (splitting off rooms) or scale (merging rooms together) based on how many people in rooms.

hope helps. if you're looking more direction, tell little more application?

update: see you're saying. after further thought, still think pre-determined areas best way go. if create new areas spontaneously there still point need break rooms (draw boundaries between rooms) , users on either side of line, if right next each other, in different rooms.

if based on lat/lng , radius around users, end odd results well. example, if user b in room user , c, users , c far each other, might see weird chat messages. example, if radius 1 mile, user a @ mile 0, user b @ mile 1, , user c @ mile 2. user a (who can see user a , user c)` chat this:

user a: hello there! 2+2? user b: 4 user a: thank you! user b: george washington user a: what?!?! 

to user b (who 1 see of messages) this:

user a: hello there! 2+2? user b: 4 user a: thank you! user c: first president of united states? user b: george washington user c: thank you! user a: what?!?! 

to user c (who can see user b , user c) this:

user b: 4 user c: first president of united states? user b: george washington user c: thank you! 

it seems spiral out of control pretty quickly. after of that, think original suggestion still best, think of them have challenges. luck!


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -