Auto attendance App Using Proximity beacon

I want to ask, how to create an algorithm using proximity beacons for automatic presence applications.