Skip to content

0.15.1

Choose a tag to compare

@balthazar balthazar released this 29 Sep 19:12
· 86 commits to master since this release

Fixes

  • Android teardown now runs on current React Native. React Native calls invalidate() on teardown instead of onCatalystInstanceDestroy(), 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 host is usually the IP there; use DNSSD if you need it. (#89)

Features

  • IPv4 addresses first, plus ipv4/ipv6 arrays on resolved services, on all platforms. (#169)
  • TXT records are published in the order given on iOS and with DNSSD on Android. publishService also accepts [key, value] pairs, useful when keys look like numbers (JS objects put those first). With NSD, the order depends on the Android system. (#176)
zeroconf.publishService('http', 'tcp', 'local.', 'MyWebServer', 8080, [
  ['txtvers', '1'],
  ['path', '/api'],
])

Notes

  • The native registerService signature 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