Client-side:iOS

make code compatible with server-side