开发者社区> 问答> 正文

用于React Native iOS的Google Cast SDK问题

我在用https://github.com/react-native-google-cast/react-native-google-cast用于集成Google CAST的库和用于IOS的Reaction本机。

我得到了频道成功但后来在试图向频道发送信息的时候,我得到sendTextMessage错误通道没有连接或没有注册到会话。

这是代码-

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

我在用-

POD‘Reaction-本机-Google-cast/No蓝牙’,PATH:‘../node_modules/react-native-google-cast/ios/’ Googlecast-SDK-无蓝牙(4.4.6) Xcode 10.3 反应本机0.59 注:使用自定义接收应用程序的Chromecast。

展开
收起
游客5akardh5cojhg 2019-12-08 23:57:08 640 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
手淘iOS性能优化探索 立即下载
From Java/Android to Swift iOS 立即下载
深入剖析iOS性能优化 立即下载