开发者社区> 问答> 正文

适用于React Native iOS的Google Cast SDK的问题

我正在使用[链接文字[地址https://github.com/react-native-google-cast/react-native-google-cast)库来集成Google Cast和iOS的react native。

我正在获取频道初始化成功,但是稍后尝试向该频道发送消息时,出现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'react-native-google-cast / NoBluetooth',路径:'../ node_modules / react-native-google-cast / ios /'

google-cast-sdk-no-bluetooth(4.4.6)Xcode 10.3

注意:使用自定义接收器应用进行chromecast。

展开
收起
几许相思几点泪 2019-12-08 22:17:19 755 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
React Native 全量化实践 立即下载
一个跨平台的云服务SDK需要什么 立即下载
React在大型后台管理项目中的工程实践 立即下载