Collecting data for proximity estimation on server

I’m developing an application to track the proximity of a user to one of 3 locations. The user will carry an iPhone that does nothing except collect the data, which can be batch uploaded to a server as a single file. I have “all the time in the world” to analyze the data on the server. The only data the app needs is a trial identifier, and other than knowing the app is collecting data, I don’t need a visual indication of what’s going on (the phone will be in the user’s pocket). If I understand correctly, I should startRangingBeaconsInRegion, specify a delegate to be notified for each ranging event, figure out which of the 3 beacons is talking, grab the rssi, and stuff that into my data structure. Am I missing anything? Anyone have some sample code (Objective C preferred)?

Thanks in advance