Beacons for tracking in training rooms

Hi guys,

I’m managing a project which consists in the development of a mobile app to track the attendance in training rooms. I will use estimote location beacons to trigger the iPhone of attendees and save their attendance in the training.

Assumptions:
Due to legal contraints, I can’t track the duration of time attendees stay in the room. I only need to know they attended the training.
I will implement location beacons in 5 training rooms (100 square meters each one of them) that are very close together.
I can’t save the attendance immediately after the attendee enters in the range of the beacon. I don’t want to spam other users that can pass near the training rooms and I need to preview the some attendees can arrive delayed. I’m thinking to implement a double check. 1) When the attendee enters in the range and 2) after 30 minutes.

Therefore, I would like to have your advise about the following questions:
May I use 1 beacon per training room or it is better to use 4 (1 on each wall of the training room) to increase accuracy: like explained in the Add Indoor Location to an iOS app documentation?
Is it technically possible to do the double check as mentioned earlier?: 1 when the attendee enters in the range and 2) after 30 minutes. If yes how? By using Location updates in the background?

Looking forward to your reply

Many thanks

It seems like all you need is a simple enter/exit API, so I’d probably recommend the Proximity SDK over Indoor SDK for this use case, and a single beacon per conf room.

With the Proximity SDK, triggering an action right upon entering the room is a given, but right after handling that event, the app will go back to sleep until the user exits the room, so the 30-minute trigger requires a bit more creativity.

1) If you can keep the app running in the background, then NSTimer should work. And yes, the Location Updates Background Mode can actually achieve that, you’d need smth like:

self.locationManager.allowsBackgroundLocationUpdates = true
self.locationManager.pausesLocationUpdatesAutomatically = false

// possibly a good idea to make iOS not use GPS and thus save energy?
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers

// on enter action:
self.locationManager.startUpdatingLocation()

// on exit action:
self.locationManager.stopUpdatingLocation()

Note that on iOS 11, even with the “Always” authorization to access Location Services, using the Location Background Mode will trigger the blue " is using your location" bar.

Plus, if you plan to submit this app to the App Store, you’ll need to explain why/how you’re using this background mode to the app reviewers.

2) If you’re saving the attendance to some backend/server of yours, maybe you can consider doing the 30-minute trigger server-side, e.g.:

  1. User enters the room.
  2. App sends “entered room” message to the server.
  3. The server queues up a job in 30 minutes to do some action (e.g. mark the attendance).

If the user exits the room before the 30-minute mark: send an “exited room” message to the server, and the server cancels the job.

Alternatively, you could just log enter/exit timestamps on the server, and once in a while run a job that takes all the durations longer than 30 minutes, and marks the attendance for the appropriate user, then deletes the timestamps so you still comply with the legal requirement? (Although that means you temporarily do hold the visit duration data, not sure if that’s okay or not.)