iOS 应用在扫描 Chromecast 设备时获得 "device authentication error"

标签 ios iphone chromecast google-cast

我正在为 Chromecast 开发 iOS 发送器应用。我设置了两个 Chromecast 设备并且能够检测并连接到它们,直到我切换到不同的测试 iPhone,现在当我尝试扫描 Chromecast 设备时,永远不会发送 deviceDidComeOnline 消息。

我能够使用示例应用重现问题 here , 与版本 2.5.1 的 GoogleCast 框架。以下是示例应用未能检测到 Chromecast 时的控制台输出:

2015-01-17 07:52:37.314 CastVideos[411:33216] Start Scan
2015-01-17 07:52:37.315 CastVideos[411:33216] -[GCKDeviceScanner startNetServiceScan]  startNetServiceScan
2015-01-17 07:52:37.341 CastVideos[411:33216] -[GCKNetworkReachability updateStatus]  updateStatus
2015-01-17 07:52:37.345 CastVideos[411:33216] -[GCKDeviceScanner networkReachabilityStatusDidChange:]  networkReachabilityStatusDidChange:1
2015-01-17 07:52:37.345 CastVideos[411:33216] -[GCKDeviceScanner purgeAllOnlineDevices]  purgeAllOnlineDevices
2015-01-17 07:52:37.489 CastVideos[411:33216] -[GCKDeviceScanner startFilteringDevice:]  starting filter for device: <0x1780b0b60:GCKDevice> ChromecastDev2 (be1be9dcbaa4cb82678b977203c3ef91)
2015-01-17 07:52:37.494 CastVideos[411:33216] -[GCKDeviceScanner startFilteringDevice:]  starting filter for device: <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f)
2015-01-17 07:52:37.629 CastVideos[411:33216] -[GCKCastSecureSocket continueHandshake]  Peer trust certificate invalid; disconnecting
2015-01-17 07:52:37.630 CastVideos[411:33216] -[GCKCastSecureSocket doTeardownWithErrorCode:]  doTeardownWithErrorCode:3
2015-01-17 07:52:37.630 CastVideos[411:33216] __42-[GCKCastSecureSocket initWithBufferSize:]_block_invoke18  Error reading from SSL buffer to stream buffer, status: -50
2015-01-17 07:52:37.630 CastVideos[411:33216] -[GCKCastSecureSocket doTeardownWithErrorCode:]  doTeardownWithErrorCode:1
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager castSocket:didDisconnectWithError:]  castSocket:didDisconnectWithError:Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager handleConnectionError:]  handleConnectionError error=Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}, _appConnectionState=0
2015-01-17 07:52:37.631 CastVideos[411:33216] -[GCKDeviceManager handleConnectionError:]  giving up on reconnect; _pausedAppID=(null), _wasConnected=0
2015-01-17 07:52:37.632 CastVideos[411:33216] -[GCKDeviceManager unregisterForAppStateNotifications]  unregisterForAppStateNotifications
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceManager disconnectWithError:isExplicit:]  disconnectWithError:(null)
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceScanner filteringFailedForDevice:withError:]  Filter failed for device <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f) with error Error Domain=com.google.GCKError Code=3 "Device authentication failure" UserInfo=0x170272180 {NSLocalizedDescription=Device authentication failure}
2015-01-17 07:52:37.634 CastVideos[411:33216] -[GCKDeviceScanner filteringFailedForDevice:withError:]  Marking device <0x1700a38a0:GCKDevice> ChromecastDev (3df5a88f22a974661a8a3556acafdd2f) invalid
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKDeviceManager unregisterForAppStateNotifications]  unregisterForAppStateNotifications
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKDeviceManager disconnectWithError:isExplicit:]  disconnectWithError:(null)
2015-01-17 07:52:37.635 CastVideos[411:33216] -[GCKCastSecureSocket disconnectWithError:]  disconnect

这发生在运行 iOS 8.0 的 iPhone 6+ 上。当我在此手机上打开其他 Chromecast 兼容应用程序(Chromecast、YouTube)时,两个 Chromecast 设备都被成功检测到。这只是我从 Xcode 运行的应用程序,并且只是在这个特定的测试手机上,似乎有这个问题。

我在其他几台测试设备上尝试了相同的示例应用程序,看看它是否与设备/操作系统有任何关系。在以下 iPhone/iPad 上检测到两个 Chromecast 设备都没有问题:

  • iOS 8.1.2 上的 iPhone 6
  • iOS 8.1.2 上的 iPhone 5
  • iOS 8.0.2 上的 iPhone 6+
  • iOS 8.0 上的 iPhone 5
  • iOS 8.0 上的 iPad Air

知道是什么原因造成的吗? 提前致谢。

最佳答案

证书问题可能是由于手机上的日期无效引起的。检查日期时间是否正确,因为这可能会导致证书问题,然后是 Chromecast 问题

关于iOS 应用在扫描 Chromecast 设备时获得 "device authentication error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27831694/

相关文章:

ios - 使用 map (苹果或谷歌)的应用程序经常因内存压力而被杀死(主要发生在进入相机时)

iphone - 从 UITabBarController 的 moreNavigationController 更改 'edit' 按钮颜色?

iphone - 获取 UITableViewCell 内 View 的绝对位置

chromecast - Chromecast 是否允许直接从 Chromecast 设备流式传输视频,还是通过移动设备传输视频

ios - 多维数组输出到标签

ios - 静态单元格中的复选框

ios - 手势识别器中的目标是什么?

iphone - 适用于 iOS iPhone 的 ICE、STUN、TURN 库

google-chrome - 如何自动 chrome-cast 网站或标签

android - 可以转换或流式传输 (Android-Chromecast) 本地文件吗?