Simon Pan wrote:
> I’ve been trying to get/post some data from my game to a webserver without success. I’m using cocos2d-x js to write code once for HTML, iOS, and Android versions of my game.
> If I try websocket i’ll also have “WebSocket is not defined” on iOS
> Is there any alternative functions I could use that are compatible with the three platforms ?
What’s your mean?
JS can use XmlHttpRequest as well like HTML version,
ensure your cocos2dx version has XmlHttpRequest.cpp/.h
please prefer my attachment.
Thanks for your quick reply guys.
I’ve checked again I have both XmlHttpRequest.cpp/.h in my project, but I have the XmlHttpHelper.h in red does that render it unusable ?
Refer to the screenshot i’ve attached