Skip to content

v2.0.9

Latest
Compare
Choose a tag to compare
@RichardRNStudio RichardRNStudio released this 14 Apr 08:23
· 15 commits to main since this release

What's Changed

  • We have refactored the entire package. It works based on a class PortScanner:
import PortScanner from 'react-native-find-local-devices';

const scanner = new PortScanner({
    timeout: 40,
    ports: [8000],
    onDeviceFound: (device) => {
      console.log('Found device!', device);
    },
    onFinish: (devices) => {
      console.log('Finished , devices:', devices);
    },
    onCheck: (device) => {
      console.log('Checking IP: ', device.ipAddress);
    },
    onNoDevices: () => {
      console.log('Finished scanning, no results have been found!');
    },
    onError: (error) => {
      // Called when no service found
      console.log('Error', error);
    },
  });

  // You can start the discovering with the following function:
  scanner.start();

  // When the discovering is running, you can cancel that with the following function:
  scanner.stop();

New Contributors

  • @gstcyr made their first contribution in #4

Thank you for your contribution @gstcyr!

Full Changelog: v1.3.5...v2.0.8