401 Unauthorized when getting app list for LG TV Using ConneckSDK

627 views Asked by At

Using ConnectSDK. I can successfully connect to a device and running device.launcher().launchNetflix() actually launches Netflix. However, most apps are launched using device.launcher().launchApp(appID: String), but no where am I able to find out what the appID is for each app. My initial thought was to use device.launcher().getAppList() to get a list of apps and load them into the tableview, but this throws a 401 user not authorized error.

1

There are 1 answers

0
keverly On

Looks like an extra pairing step is required for certain features and just connecting is not enough. Instructions on pairing can be found here. Just scroll down to where it says "Pairing Level". Essentially your code should look like this:

discoveryManager = DiscoveryManager.shared()
discoveryManager?.pairingLevel = DeviceServicePairingLevelOn
discoveryManager?.startDiscovery()

This will require the user to enter a code from their TV into your app. Once they have paired, the 401 errors should go away for most these features.