websocketsamsung-smart-tvremote-control

Samsung TV Duplicates Permission Websocket


I am developing a samsung remote app and using websockets to connect to the samsung tv. I am opening socket through this url "wss://ip:8002/api/v2/channels/samsung.remote.control?name=". All of this works fine but there is an issue that the TV asks for the permission everytime I try to open connection through websocket. I have seen other competitor apps and in these apps the TV only asks for permission for the first time.

Can anyone help me with this ?


Solution

  • I have figured this out. All you have to do is add a token in the socket URL. When you connect to the TV for the first time or without having any token in the URL, the TV responds with a dictionary having that "Token" as a key/Value pair. Just use that token while connecting to the TV.

    SAMPLE URL:- wss://ip:8002/api/v2/channels/samsung.remote.control?name=someName&token=tokenValue