Repository navigation
0.15.1
Fixes
- Android teardown now runs on current React Native. React Native calls
invalidate()on teardown instead ofonCatalystInstanceDestroy(), so scans were never stopped on reload. Teardown now runs from both, and events sent while the JS side is gone are dropped instead of throwing. - Services are unpublished on teardown (e.g. reload), on iOS and Android. If the app process is killed it can't announce anything: other devices drop the service once its mDNS records expire. (#117)
- Android NSD returns all addresses on Android 14+ and the mDNS hostname on Android 16+. Older Android versions don't expose the hostname, so
hostis usually the IP there; useDNSSDif you need it. (#89)
Features
- IPv4 addresses first, plus
ipv4/ipv6arrays on resolved services, on all platforms. (#169) - TXT records are published in the order given on iOS and with
DNSSDon Android.publishServicealso accepts[key, value]pairs, useful when keys look like numbers (JS objects put those first). WithNSD, the order depends on the Android system. (#176)
zeroconf.publishService('http', 'tcp', 'local.', 'MyWebServer', 8080, [
['txtvers', '1'],
['path', '/api'],
])Notes
- The native
registerServicesignature changed (TXT records are now an array), so rebuild your app after upgrading. The JS API is unchanged. - Android: NSD uses
getHostAddresses()on Android 14+, so the app must compile against SDK 34 or newer (the default for React Native 0.73+).
Full Changelog: 0.15.0...0.15.1