We are creating a multi-platform apps for both Android and iOS.
Currently, we have a services that is published in Android with these information
Type:_http._tcp or _http._udp
Name: abcController
port
Now, I want to browse "abcController" services in iOS apps to get the list of host (ip) for connecting. I'm trying to do it with these code
NSString* servicesOfType = @"abcController._http._tcp.";
NSString* domain = @"";
domainBrowser = [[NSNetServiceBrowser alloc] init];
[domainBrowser setDelegate:self];
[domainBrowser searchForServicesOfType:servicesOfType inDomain:domain];
However, it only calls netServiceBrowserWillSearch and doesn't have any response.
Any helps is very appreciate !
I found the solution for my issue. It turns out that my service is published in udp, therefore. withthiscode.
I can receive my service now.