ConsumerIrManager Android in NativesCript


#1

Hi everybody, I’m trying to send an Ir Frame through a NativeScript App on my Android Device (that of course, it supports IR).
My problem is that it seems like my Android devices is not sending any IR frame.
My code is:

sendIr()
{
      let iR = android.hardware.ConsumerIrManager;      
      var context = android.content.Context;
      iR = application.android.context.getSystemService(context.CONSUMER_IR_SERVICE);
      
      if (application.android && platform.device.sdkVersion >= "19") 
      {
        if (iR.hasIrEmitter()) 
        {
            this.sending = "We are sending";                       
            var pattern = [1901, 4453, 625, 1614, 625, 1588, 625, 1614, 625, 442, 625, 442, 625,
                468, 625, 442, 625, 494, 572, 1614, 625, 1588, 625, 1614, 625, 494, 572, 442, 651,
                442, 625, 442, 625, 442, 625, 1614, 625, 1588, 651, 1588, 625, 442, 625, 494, 598,
                442, 625, 442, 625, 520, 572, 442, 625, 442, 625, 442, 651, 1588, 625, 1614, 625,
                1588, 625, 1614, 625, 1588, 625, 48958]
            iR.transmit(38000, pattern);
        }       
  }

Has anyone knows if i’m doing it properly?
Could be that NativeScript does not support ConsumerIrManager? But it seems like if it’s supported because if i did that:

....
iR.inventedFunction(38000, pattern);
....

This error appears

....
Typeerror: iR.inventedFunction is not a function (....)
....

Thank you very much