triniwiz / nativescript-socketio

Socket.IO for nativescript
Apache License 2.0
71 stars 31 forks source link

Unable to set cookies when using Angular #91

Closed ajaymaru closed 5 years ago

ajaymaru commented 5 years ago

Make sure to check the demo app(s) for sample usage

Done.

Make sure to check the existing issues in this repository

One related issue in the past but I believe the solution to that broke the functionality for Angular.

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it. When trying to set cookies in app.module.ts, no cookies are transmitted and the options for cookies is ignored: SocketIOModule.forRoot(<url_value>, { debug: true, cookies: ["<name>=<value>; Domain=<domain_value>; Path=/; Expires=<expiration_time>"], forceNew: true, forceWebsockets: true, secure: true })

Is there any code involved?

See above.

The issue is that the interface IOOptions defined in angular/index.d.ts specifies the key as 'cookies' whereas socketio.ios.ts and socketio.android.ts look for key 'cookie'.

Easy fix. Sending a PR.

ajaymaru commented 5 years ago

PR #93 submitted