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:
// on exit action:
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.:
- User enters the room.
- App sends “entered room” message to the server.
- 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.)