NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

browser based interface works on Android and iOS , advanced does't work on both at all #29

Closed c1ngular closed 6 years ago

c1ngular commented 7 years ago

i have tried to use this plugin to connect to a 3rd party websocket service , tried both , the browser based and advanced ones , the browser based one works on Android and iOS platforms , but it truncates received json string on iOS platform(simulator), android (device) seems working fine ; the advanced one does not work at all on both platforms~

NathanaelA commented 7 years ago

@c1ngular - I need an example of it failing. I'm currently using this in a project and I'm not having either of those issues.

c1ngular commented 7 years ago

@NathanaelA will do , I just don't have it now , cuz I was just messing around this plugin since I believe it is very crucial to many scenarios ~

from what I have tried so far , browser based interface works well on both platforms , advanced one did not work for me in exactly same use case, none event fired at all , no error message or crash either, so I can't really tell what is going on ~

I first tried the advanced one , since it has "reopen " feature!

NathanaelA commented 7 years ago

On the advanced one, did you call the open function; you need to manually open the socket after setting it all up. This is one difference that catches a lot of people. But I wanted the developer to have full control over everything... The browser version auto-opens the websockets during creation.

c1ngular commented 7 years ago

@NathanaelA I did , will try again to confirm ! Does it matter the timing(navigation event/stage) of initializing and calling this plugin ? I have even tried using this plugin in web worker , browser based one still works , advanced still doesn't ! Thanks

c1ngular commented 7 years ago

@NathanaelA i tried copy the example codes of both (advanced/browser based) interfaces , and pasted it each on a different web workers(both connecting to same secure ws protocol ) , the browser based one works fine on both platforms ; the advanced one is working on Android platform this time, though some time it gives log as below: JS: === dump(): dumping members === JS: { JS: "message": "Uncaught SyntaxError: Unexpected token )", JS: "stackTrace": "SyntaxError: Unexpected token )\n at require (<anonymous>:1:266)", JS: "filename": "undefined", JS: "lineno": 1 JS: } JS: === dump(): dumping function and properties names === JS: === dump(): finished === i guess both interfaces are giving logs like above , is it something to do with plugin code style or format ? the advanced one does not work on iOS and gives no error or log at all , just silent ~

NathanaelA commented 6 years ago

Please retry with the latest (v1.4.0 or later)