I am using google casting through my app. It is working good but I am not able to hide the casting button when the cast device goes offline. It hides automatically but after a long time. How can I hide it immediately. Is there a way to get the notifications from the device scanner class.
You should try adding listener
[self.deviceScanner addListener:self];
[self.deviceScanner startScan];
#pragma mark - GCKDeviceScannerListener
- (void)deviceDidComeOnline:(GCKDevice *)device {
NSLog(@"device found!! %@", device.friendlyName);
[self updateCastIconButtonStates];
if ([self.delegate respondsToSelector:@selector(didDiscoverDeviceOnNetwork)]) {
[self.delegate didDiscoverDeviceOnNetwork];
}
}
- (void)deviceDidGoOffline:(GCKDevice *)device {
[self updateCastIconButtonStates];
}
Update
Similar Question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With