我正在使用適用於Chromecast的iOS發件人應用。我設置了兩個Chromecast設備,並且能夠檢測並連接到它們兩個,直到我切換到另一個測試iPhone,並且現在當我嘗試掃描Chromecast設備時,deviceDidComeOnline消息從不發送。iOS應用在掃描Chromecast設備時收到「設備身份驗證錯誤」
我可以在這裏用示例應用程序(https://github.com/googlecast/CastVideos-ios)重現問題,使用GoogleCast框架的2.5.1版本。以下是示例應用在未檢測到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運行的應用程序,而在這款特定的測試手機上,似乎有這個問題。
我試了幾個其他測試設備上的同樣的示例應用程序,看它是否與設備/操作系統有任何關係。沒有問題同時檢測到Chromecast設備上的以下的iPhone/ipad公司:
- iPhone 6在iOS 8.1.2
- iPhone 5在iOS 8.1.2
- iPhone 6+在iOS 8.0.2
- iPhone 5在iOS 8.0
- 產品iPad Air在iOS 8.0
任何想法會導致此? 在此先感謝。