jhooda / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

- (instancetype)initWithFilterCriteria:(GCKFilterCriteria *)filterCriteria; #622

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Initialising scanner wit this method causes the scanner will never find my 
Chromecast device.

GCKFilterCriteria * filterCriteria = [GCKFilterCriteria 
criteriaForAvailableApplicationWithID:@"MY-APP-ID-HERE"];
_scanner = [[GCKDeviceScanner alloc] initWithFilterCriteria:filterCriteria];

string @"MY-APP-ID-HERE" is replaced to my application ID.

Original issue reported on code.google.com by zaychenk...@gmail.com on 3 Aug 2015 at 12:16

GoogleCodeExporter commented 9 years ago
If you haven't already done so, you'll need to add a listener and start the 
scan. The following code comes from the iOS sender documentation 
(https://developers.google.com/cast/docs/ios_sender#scan):

//Establish filter criteria
GCKFilterCriteria *filterCriteria = [GCKFilterCriteria 
criteriaForAvailableApplicationWithID:kReceiverAppID];

//Initialize device scanner
self.deviceScanner = [[GCKDeviceScanner alloc] 
initWithFilterCriteria:filterCriteria];
[self.deviceScanner addListener:self];
[self.deviceScanner startScan];

Note that the scanner will show only devices that can run your app. If you 
haven't yet published your sender/receiver to the developer console, it will 
only show up on whitelisted devices.

You can also check out the iOS sample apps on the Googlecast Github page 
(https://github.com/googlecast) for some examples on how to build an iOS 
sender. For any future development issues, please direct your questions to 
Stack Overflow: http://stackoverflow.com/questions/tagged/google-cast or 
http://stackoverflow.com/questions/tagged/chromecast

Original comment by jonathan...@google.com on 3 Aug 2015 at 5:05

GoogleCodeExporter commented 9 years ago
Our cast device has been published and it's working good with Android SDK.

Original comment by zaychenk...@gmail.com on 4 Aug 2015 at 10:53

GoogleCodeExporter commented 9 years ago
And it's working good with this method:
_scanner = [[GCKDeviceScanner alloc] init];

but -(instancetype)init; has been deprecated.

Original comment by zaychenk...@gmail.com on 4 Aug 2015 at 10:55

GoogleCodeExporter commented 9 years ago
Issue 623 has been merged into this issue.

Original comment by jonathan...@google.com on 4 Aug 2015 at 6:05

GoogleCodeExporter commented 9 years ago
Can you implement the GCKLogger delegate and provide the logs from the scan?

Original comment by jonathan...@google.com on 4 Aug 2015 at 6:06

GoogleCodeExporter commented 9 years ago
2015-08-06 17:00:00.764 [286:41520] -[GCKDeviceScanner startNetServiceScan]  
startNetServiceScan
2015-08-06 17:00:01.910 [286:41520] -[GCKDeviceScanner 
netServiceBrowser:didFindService:moreComing:]  found Chromecast0884,_7FFA8CAD
2015-08-06 17:00:01.911 [286:41520] -[GCKDeviceScanner 
netServiceBrowser:didFindService:moreComing:]  resolving Chromecast0884
2015-08-06 17:00:01.915 [286:41520] -[GCKDeviceScanner 
netServiceBrowser:didFindService:moreComing:]  found Chromecast0884,(null)
2015-08-06 17:00:04.974 [286:41520] -[GCKDeviceScanner 
netService:didNotResolve:]  Failed to resolve net service 'Chromecast0884' with 
error dictionary {
    NSNetServicesErrorCode = "-72007";
    NSNetServicesErrorDomain = 10;
}

Original comment by zaychenk...@gmail.com on 6 Aug 2015 at 2:15

GoogleCodeExporter commented 9 years ago
That's the standard behavior for NSNetService provided by iOS. Please see the 
"When resolving fails" section at 
https://developer.apple.com/library/mac/documentation/Networking/Conceptual/NSNe
tServiceProgGuide/Articles/ResolvingServices.html

Original comment by jonathan...@google.com on 10 Aug 2015 at 5:14