Skip to content
المشاريع

balthazar/react-native-zeroconf

عرض على GitHub

حول

:satellite: Discover Zeroconf services using react-native

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
؜-١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

react-native-zeroconf: Bonjour / mDNS discovery and publishing for React Native, on iOS, Android, Windows, macOS, tvOS and Expo

npm version npm downloads tests windows license

Find the services other devices advertise on the local network (printers, speakers, cameras, your own servers) and advertise your own, on iOS, Android, macOS, tvOS and Windows.

Read the documentation

Installation

yarn add react-native-zeroconf
cd ios && pod install

1.0 release candidate: one C++ native module on every platform, for React Native 0.82 and later (New Architecture, Expo SDK 55 and later). Try it with npm install react-native-zeroconf@next, see what changes from 0.17. The documentation covers 0.17, which stays the default and keeps getting bug fixes.

On iOS, declare the service types you use in NSBonjourServices, see Permissions and Setup. Expo works with development builds, see Installation with Expo.

Usage

import { useZeroconf } from 'react-native-zeroconf'

function Printers() {
  const { services } = useZeroconf({ type: 'ipp' })

  return services.map(service => (
    <Text key={service.name}>
      {service.name} {service.ipv4[0]}:{service.port}
    </Text>
  ))
}

Without React:

import Zeroconf from 'react-native-zeroconf'

const zeroconf = new Zeroconf()
zeroconf.on('resolved', service => console.log(service.name, service.host, service.port))
zeroconf.scan({ type: 'http' })

Documentation

License

MIT, see LICENSE. Includes RxDNSSD (Apache 2.0, see NOTICE) and Apple's mDNSResponder (mostly Apache 2.0, see its LICENSE).

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…