title: How can I send a message to a custom Google Cast Receiver from Chrome for iOS?
body: <p>I'm using the <a href="https://github.com/googlecast/CastHelloText-chrome" rel="nofollow">CastHelloText-chrome</a> example and am able to get it all working just fine from the Chrome browser on my desktop, however, when I try to use Chrome on my iOS device, I receive the following error when trying to create a session:</p>
  
  <blockquote>
    <p>{ "code": "channel_error", "description": "The operation couldn't be completed. (com.google.chrome.ios.cast error 2.)" }</p>
  </blockquote>
  
  <p>This error happens when executing the following:</p>
  
  <pre><code>chrome.cast.requestSession(function(e) {
      session = e;
      session.sendMessage(namespace, message, onSuccess.bind(this, "Message sent: " + message), onError);
    }, onError);
  </code></pre>
  
  <p>Specifically, this seems to happen on the <code>requestSession</code> function call (the nested callback never actually executes).</p>
  
  <p>Everything up until this point seems to work.  In fact, on my iOS device, I even receive the popup asking where to cast to (Chromecast) and once I select it, my Chromecast does indeed display my custom receiver.  However, I still receive that error message and never get a session object, so I can't send messages to the receiver.</p>
  
  <p>Like I said, this seems to work fine on my desktop Chrome browser, but does not work on my iOS Chrome browser.  Does this sample not work on iOS devices?  Is there a way to make it work?</p>