1

we are able to make communication from sender to receiver. but we can only send NUMBERS as a custom message ex: 123,45, etc when we try to attach any string content eg: hello,hello122 or any character the receiver side does not get any message. We have executed the following code :

try {
    const channel = "urn:x-cast:testChannel";
    const iframe = document.getElementById("frame");
    const node = document.getElementById("message");
    const ctx = cast.framework.CastReceiverContext.getInstance();
    node.innerHTML = 'test1';
    ctx.addCustomMessageListener(channel, (evt) => {
      node.innerHTML = 'test...';
      ctx.sendCustomMessage('urn:x-cast:testChannel', evt.senderId, 'Message Invoked v3', (data) => {
        document.getElementById("message").innerHTML = 'message sent';
        iframe.src = "https://duchy-messages.bradnin.ch/";
        node.innerHTML = 'Message sent '
      })

      node.innerHTML = evt.senderId+ ' test ' +JSON.stringify(evt);
      alert('here');
    })

    ctx.start();
  } catch (e) {
    document.getElementById("message").innerHTML = JSON.stringify(e);
  }
Anirban iOS
  • 957
  • 7
  • 14
akash gaur
  • 303
  • 1
  • 3
  • 9
  • You can try to add feature to your CAF receiver wherein you can customize your message. Here is the [documentation](https://developers.google.com/cast/docs/caf_receiver_features) regarding this new feature. – Jessica Rodriguez Oct 05 '18 at 08:20

0 Answers0