Search code examples
swiftbluetoothgpsproximity

Best way to build a proximity app within 200 meter range of the user?


I am using Swift to develop a personal app for my family and have been researching methods of what toolset to use to build an app that allows a user to see other people using the same app in a vicinity of around 0 - 200meters.

I was looking at bluetooth and also trying to work out how Tinder finds other users. Do they just use GPS? If so how would one best implement that.

What would be the most effective way to determine another users location within 200 meters?

Note: 1 user would search the surrounding area for any devices that are on the app - Then it would tell the user their location. So it is doing both, finding the distance between the two locations and how you should get to that location. Obviously as this is for personal use, security issues arent much of a concern.


Solution

  • As you may have expected, you have many options of different approaches that will all accomplish your goal. I suggest you start by taking a look at a couple open-source projects:

    1. PeerKit
    2. LocationChat

    Both of these libraries demonstrate a way to transfer a payload of data between devices. In addition, both projects provide very helpful example apps.

    Assuming you choose to use PeerKit, each device could be responsible for obtaining its own location (via CoreLocation) and then broadcasting it to other devices (via PeerKit). Then the receiving device will be able to calculate the distance between itself and its nearby peers.


    Note: At the time of writing, I have not contributed to either of the projects suggested above.