refactor code and add ios lib for weixin