Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Issue with Google Cast SDK for React Native iOS

$
0
0

I am using https://github.com/react-native-google-cast/react-native-google-cast library for integration google cast with react native for iOS.

I am getting channel init success but later while trying to send message to channel, I get sendTextMessage error Channel is not connected or is not registered with a session.

Here is the code -

 sendMediaGetMessage() {
    console.debug("entry: sendMediaGetMessage");
    console.debug("WatchV:registering channel " + CastConstant.MESSAGE_CHANNEL);
    GoogleCast.initChannel(CastConstant.MESSAGE_CHANNEL)
      .then(() => {
        console.debug("WatchV:channel init success");
        GoogleCast.sendMessage(
          CastConstant.MESSAGE_CHANNEL,
          JSON.stringify({ intent: "get_media" })
        )
          .then(() => {})
          .catch(error => {
            console.log(error);
          });
      })
      .catch(function(err) {
        console.debug("WatchV:error: sendMediaGetMessage");
        console.log(err);
      });
  }

I am using -

  • pod 'react-native-google-cast/NoBluetooth', path: '../node_modules/react-native-google-cast/ios/'
  • google-cast-sdk-no-bluetooth (4.4.6)
  • Xcode 10.3
  • React native 0.59

Note: Using a custom receiver app for chromecast.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>