domain parameter recommendation?
react-native-zeroconf's scan method takes three parameters: type, protocol, and domain. It looks like the Android implementation doesn't make any use of the domain parameter at all. The iOS implementation does make use of the domain parameter.
From the iOS searchForServicesOfType:inDomain: documentation
The domainName argument can be an explicit domain name, the generic local domain @"local." (note trailing period, which indicates an absolute name), or the empty string (@""), which indicates the default registration domains. Usually, you pass in an empty string. Note that it is acceptable to use an empty string for the domainName argument when publishing or browsing a service, but do not rely on this for resolution.
I'm wondering where the iOS and Android implementations meet. Since the Android implementation does not use a domain parameter, does that mean Android is always doing the same as if the domain parameter was an empty string?
In order to get matching behaviour, should we use an empty string when calling react-native-zeroconf's scan method?
Thanks!!
Good point. Because Android doesn't support the domain, I just felt ignoring it and returning the full result was a better way of handling it. Maybe add our own custom filtering for the Android results would be nice, but I am not quite sure honestly
Thanks.
Do you think using the empty string is the best option in order to have matching results on both iOS and Android?
I would say so yes