Showing Multiple User Locations

Hi all,


Just a quick question!


I have recently been chatting with some colleagues about an app idea, the app would need to show multiple user locations on a map (think Find My Friends) that is updated freqently. Without going into the detail with regards to privacy, which we have discussed in length, is this something that is possible using MKMapKit?


If this is possible what would be the best way to go about granting access for other users to be able to see your current location?


Thanks for the advice ;-)

Answered by junkpile in 153752022

Yes. There is no API for easy direct peer-to-peer communication between devices not on the same LAN (multipeer connectivity might work for devices physically very close together, but since you're talking maps, I doubt that would work for you). So a server would be needed.


It wouldn't have to be a "third party" server; you could use CloudKit or something. But in my opinion some sort of server would be required.

Sure. You could display whatever annotations you want on the map.


You would need a server to coordinate everything. Individual devices post their locations to the server, and request the list of stuff they should display on the map.

Thanks for the reply junkpile.


Is this something that would need to be done through a third party server? In other words are you suggesting that you grab the users current lat/long coordinates, upload those coordinates and update the recipients device (map) as appropriate?

Accepted Answer

Yes. There is no API for easy direct peer-to-peer communication between devices not on the same LAN (multipeer connectivity might work for devices physically very close together, but since you're talking maps, I doubt that would work for you). So a server would be needed.


It wouldn't have to be a "third party" server; you could use CloudKit or something. But in my opinion some sort of server would be required.

Great thanks for the help ;-)


How could someone else grant access to another user (friend) to see their location - is there an API for that?


What I mean is if we were to use something like CloudKit, how would we access another users cloud details to retrieve the relevant lat/long that would have been uploaded by the device.

**Scrap that** - I just took a look at CloudKit and its purpose, I think I have answered my own question!

You would have to build that API yourself to be provided by your server. Just like Facebook, for example, no doubt has an internal representation of who is allowed to see what (friends, people who are tagged in posts, etc.). Their web and mobile apps use some internal API they developed in order to tell the back end who should be able to see a post. You would develop something similar. Probably nowhere near as complex as Facebook's system but the gist of it is, there is no such support in iOS except maybe GameCenter if you're talking about a game. So you'd have to roll your own.

Thanks for your time...much appreciated.

Showing Multiple User Locations
 
 
Q