【发布时间】:2015-03-06 01:40:47
【问题描述】:
我正在开发适用于 Chromecast 的 iOS 发件人应用。我设置了两个 Chromecast 设备,并且能够检测并连接到它们,直到我切换到不同的测试 iPhone,现在当我尝试扫描 Chromecast 设备时,永远不会发送 deviceDidComeOnline 消息。
我能够使用 GoogleCast 框架 2.5.1 版的示例应用程序 here 重现该问题。以下是示例应用无法检测到 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
知道是什么原因造成的吗? 提前致谢。
【问题讨论】:
标签: ios iphone chromecast google-cast