balthazar / react-native-zeroconf

:satellite: Discover Zeroconf services using react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot start scan on iOS14

RyQuantum opened this issue · comments

iPhone 8p, iOS14,
"react-native": "0.62.2",
"react-native-zeroconf": "^0.12.4",

I run the example but failed, even cannot start scan:
scan

And I get the error code:
image

Does anyone know how to solve it?

Make sure you specificy the service you're scanning for.
https://github.com/balthazar/react-native-zeroconf#ios-14-permissions

Yes. I have added them. Here is my Info.plist:
image
But still the same error

The same issue. Is there a solution? My ios app have been crashed on .scan() method.

@ilyalezhnev @mayue3434 Make sure the Bonjour service in the plist is an actual service, as in _your-bonjour-service._tcp -> this works for me.

In my case I was searching for an Arduino service. My values on iOS 14:
Info.plist

<key>NSBonjourServices</key>
<array>
	<string>_arduino._tcp.</string>
</array>

Scan:

zeroconf.scan('arduino', 'tcp') // _arduino._tcp

You inspire me. I modify my code to:
Info.plist

<key>NSBonjourServices</key>
<array>
	<string>_http._tcp.</string>
</array>

js code:

zeroconf.scan('http', 'tcp')

It works. Thank you all so much.