Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Getting 1006 code on iOS #92

Open
danishashraf047 opened this issue Jul 8, 2021 · 1 comment
Open

Getting 1006 code on iOS #92

danishashraf047 opened this issue Jul 8, 2021 · 1 comment

Comments

@danishashraf047
Copy link

I'm getting 1006 code on iOS. It is working fine on Android. You can also see in code if I'm doing wrong so please let me correct.

            var mySocket = new WebSocket("wss://eu.rtm.tiledesk.com/v2/ws/?token=JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWJkODkwMjkyYmVmZTAwMTkwNTQ5NzMiLCJlbWFpbCI6ImFuZHJlYWxlb0B0aWxlZGVzay5jb20iLCJmaXJzdG5hbWUiOiJBbmRyZWEiLCJsYXN0bmFtZSI6IkxlbyIsImVtYWlsdmVyaWZpZWQiOnRydWUsImlhdCI6MTYwMTQ3NTYyMywiYXVkIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJpc3MiOiJodHRwczovL3RpbGVkZXNrLmNvbSIsInN1YiI6InVzZXIiLCJqdGkiOiJlMGZjYjkxZC1mNzg5LTRiZDItODUyMC0zZDlkNzNiNGEyMDUifQ.ZGdoGhiW80DpPBiJ5WL3TEogwj3u1zSTtDseLUf2U0s", []);
            mySocket.addEventListener('open', function (evt) { console.log("We are Open"); });
            mySocket.addEventListener('message', function (evt) { console.log("We got a message: ", (evt as any).data); (evt as any).target.close(); });
            mySocket.addEventListener('close', function (evt) { console.log("The Socket was Closed:", evt.code, evt.reason); console.log(evt) });
            mySocket.addEventListener('error', function (evt) { console.log("The socket had an error", (evt as any).error); console.log(evt) });

It would be great if you could solve this issue. Thanks

@NathanaelA
Copy link
Owner

This might be caused by: ?token=JWT eyJhb.. See that space in there, it probably needs to be changed to a %20. Can you see if that would fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants