REMOTE CONTROL LG TV

Hello, I am developing a library to control LG televisions. I couldn’t find documentation with APIs to do this. const authenticateTV = async () => {
try {
const response = await axios.post(http://${ipAddress}:8080/roap/api/auth, {
type: ‘AuthKeyReq’,
});
setSession(response.data.session);
} catch (error) {
console.error(‘Authentication failed’, error);
}
};

const sendCommand = async (command) => {
try {
if (!session) {
console.error(‘Authentication required’);
return;
}

   const response = await axios.post(`http://${ipAddress}:8080/roap/api/command`, {
     name: 'HandleKeyInput',
     value: command,
     session,
   });

   console.log('Command sent:', response.data);
 } catch (error) {
   console.error('Failed to send command', error);
 }

};

I wonder if it would be correct if I send a request like this using React Native. Thank you, I’m a new developer :confused:

Connect SDK supports connecting external devices. Please visit https://connectsdk.com and find more information. Thank you.