cgewecke / beacon-testing

Template for an iOS beacon-based proximity app where identity derives from an arbitrary social network.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signal Detection Issues

cgewecke opened this issue · comments

The central issue is that background monitoring only wakes up the app on initial entry into a region. There are cases where one phone is backgrounded but two or more are foregrounded that require the later entrants 'infer' proximity from the list of connections made by the first.

One solution is to exploit the 20 uuid cap to minimize the probability of duplicate signal happening.(5%). So, changes:

a) Set email field to "major_minor_uuid". This will speed up mongo finds? Receiver will generate that string from the signal and pass it in the server call.

b) App should maintain array of uuids to range for. On account creation, it should distribute them evenly by doing:
index = major modulo # of uuids
myUUID = uuidArray[index].

In the field you can sweep the db if you detect a shared region (the other app will be foregrounded), get a list of their connections and compare their receivers to yours. Anyone you're missing, add and mark as 'inferred' connections. When the transmitter exits region, remove them and any inferred records from your slice of the db. When a receiver exits a region they will remove themselves . . . that case doesn't need to be handled. This approach will be inaccurate if the transmitter departs, but the backgrounded receiver remains. At least you will have seen them. Inferred receivers proximity to you should be expressed as proximity to the real transmitter.