Added error state return codes for iOS.