Updating iOS version of the SDK to be 3.1 compatible

Credit goes to Damien Hou for doing most of the work here. Thanks, Damien!