pomelo icon indicating copy to clipboard operation
pomelo copied to clipboard

How to use Pomleo client in Cocos2d jsb?

Open zxh1982 opened this issue 13 years ago • 9 comments

zxh1982 avatar Oct 15 '13 02:10 zxh1982

you can use pomelo-jsclient-websocket

fantasyni avatar Oct 15 '13 02:10 fantasyni

I use pomelo-jsclient-websocket in jsb prompted wrong, is not defined window. I pre-var windows = {}, and tips Protocol does not exist. I use pomelo-jsclient-scoet.io in jsb prompted pomelo-client.js: 84: ReferenceError: EventEmitter is not defined, but also dependences the code in the node.js

zxh1982 avatar Oct 15 '13 02:10 zxh1982

cocos2d jsb no node.js environment, if you want to use in cocos2d jsb Pomleo Clinet need to c language version of the api to bind to js on?

zxh1982 avatar Oct 15 '13 02:10 zxh1982

pomelo-jsclient-websocket is pure javascript client, no need node.js environment

fantasyni avatar Oct 15 '13 03:10 fantasyni

pomelo-jsclient-websocket need Browser environment?

zxh1982 avatar Oct 15 '13 03:10 zxh1982

var Protocol = window.Protocol; var Package = Protocol.Package; var Message = Protocol.Message; var EventEmitter = window.EventEmitter; ///---------------------------- In cocos2d jsb environments Protocol, EventEmitter are not defined!

zxh1982 avatar Oct 15 '13 03:10 zxh1982

window is the global object in javascript

fantasyni avatar Oct 15 '13 03:10 fantasyni

Only in Cocos2d jsb js to cocos2d-x binding and js built-in data types, no other things. js virtual machine using SpiderMonkey (SpiderMonkey is Mozilla's JavaScript engine written in C / C + +. It is used in various Mozilla products, including Firefox, and is available under the MPL2.)

zxh1982 avatar Oct 15 '13 05:10 zxh1982

Hi. How to use Pomleo client in Window phone? Thanhks.

ducnvjki avatar Jul 07 '14 10:07 ducnvjki