jareksedy / WebOSClient

WebOSClient is a Swift library designed to facilitate communication with Smart TVs running WebOS.
MIT License
14 stars 4 forks source link

How to find Apps ID #5

Closed Coger541 closed 3 months ago

Coger541 commented 3 months ago

How to find out other apps Id like youtube, disney, prime video etc. I have app ID for other apps but those are for android smart tv not LG like For prime video app Id is: https://app.primevideo.com And for spotify: spotify://

Does these android apps Id also works for LG ?

At here client?.send(.launchApp(appId: "netflix"))

Coger541 commented 3 months ago

@jareksedy any suggestion ??

jareksedy commented 3 months ago

Sure, that's easy, first you send the command to get the list of all installed apps

requestId = client?.send(.listApps)

where client is your WebOSClient instance, and requestId some string variable.

then you handle the response in the didReceive delegate method like that:

    func didReceive(_ result: Result<WebOSResponse, Error>) {
        if case .success(let response) = result, response.id == requestId {
             let applications: [WebOSResponseApplication] = response.payload?.applications ?? []
        }
}