iOS client Code