问题
Google Chrome cast api of ios have the following methods of device discovery
- (void)deviceDidComeOnline:(GCKDevice *)device {
// : manipulate UI
[self.tableView reloadData];
}
- (void)deviceDidGoOffline:(GCKDevice *)device {
//: manipulate UI
[self.tableView reloadData];
} this runs fine at the start of application and the devices are added to UI normally because I add a listener to it and start the scan when startScan method that typically runs for 5 seconds but if now i switch the source from TV or unplug the device from TV device deviceDidGoOffline method is not called. How can I have a notification posted once the device have gone offline?
回答1:
There is currently a bug in the SDK which affects this feature. It will be addressed in the next release.
来源:https://stackoverflow.com/questions/21167241/managing-gckdevices-on-app-when-user-switch-tv-source