balthazar / react-native-zeroconf

:satellite: Discover Zeroconf services using react-native
MIT License
220 stars 99 forks source link

iOS14 use zeroconf scan Error #142

Open BigFaceCatQuQ opened 3 years ago

BigFaceCatQuQ commented 3 years ago

BF6E3E51-86B8-4A7A-B15A-D23510BCD6B2_1_101_o

image

BigFaceCatQuQ commented 3 years ago

this problem has been solved, my config went wrong

Vannevelj commented 3 years ago

@BigFaceCatQuQ can you clarify what the issue was with your config? I'm seeing this error when I go through these steps:

  1. Resolve a service
  2. Background the app
  3. Stop the service advertisement
  4. Foreground the app

Edit: found the underlying issue! Solution detailed in https://github.com/balthazar/react-native-zeroconf/issues/23#issuecomment-736020508

salmazov commented 3 years ago

The same problem. I just start scanning and I have the same error on iOS. Android version works pretty good!

tavrez commented 3 years ago

I also have this problem. On Android everything is fine. on iOS 12 everything is also fine. but iOS 14 shows same error. I configured info.plist according to readme. when I call zeroconf.scan("... in componentdidmount this happens(no sleep lock screen etc)

tavrez commented 3 years ago

Update, my problem solved. For me it was a problem because of info.plist . If you do zeroconf.scan('TOPIC','tcp') then you need <string>_TOPIC._tcp</string> in info.plist. I think document should be updated to clearly show this. Also I feel like NSLocalNetworkUsageDescription needs to be on top of NSBonjourServices, but I'm not sure.