cannot create communication from sender to receiver CAF v3

357 Views Asked by At

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);
  }
0

There are 0 best solutions below