Toxblh / samsung-tv-control

📺 Remote control your TV via JS!
https://toxblh.github.io/samsung-tv-control/
MIT License
178 stars 35 forks source link

Direct access app like Neflix, Primevideo not open using AppID #304

Open jaydipbvi opened 5 months ago

jaydipbvi commented 5 months ago

We have tried using wss and http both connection but not able to open Netflix, Prime Video app direct throw any button.

WSS connection not work with any Apps but HTTP connection worked with YouTube, Spotify apps.

Param for WSS connection

` method: ms.channel.emit

let subParam = ["action_type":"DEEP_LINK","appId":appId]//DEEP_LINK//NATIVE_LAUNCH let param = TVRemoteCommand.Params(data: subParam, event: "ed.apps.launch",to: "host")`

Req for HTTP connection; `
let appId = "111299001912" let strURL = "http://192.168.5.40:8001/api/v2/applications/\(appId)" guard let url = URL(string:strURL) else { return } var request = URLRequest(url: url)

    request.allHTTPHeaderFields = ["Authorization": "Bearer access_token",
                                   "Content-Type": "application/json"]
    request.httpMethod = "POST"  //Use POST method for app launch
    let task = URLSession.shared.dataTask(with: request) { data, response, error in
        guard let data = data, error == nil else {
            print("Error: \(error?.localizedDescription ?? "")")
            return
        }
        if let responseString = String(data: data, encoding: .utf8) {
            print("Response: \(responseString)")
        }
    }
    task.resume()`