sample code for beacon ios app