1.0.6 • Published 2 years ago

@devjay/rn-internet-connectivity-devjay v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Native Internet Connectivity Checker

GitHub license

A React Native package that allows you to check the internet connectivity of a device.

Installation

  1. Install the Internet Connectivity Package:

In your React Native project directory, install your package using npm or yarn.

npm install rn-internet-connectivity-devjay
or 
yarn add rn-internet-connectivity-devjay

Usage:

  1. Create a React Native Project:

Start by creating a new React Native project or use an existing one where you want to check internet connectivity.

  1. Use the Package in Your Code:

Import and use the package in your React Native code.

import { isDeviceConnectedToInternet } from 'rn-internet-connectivity-devjay';

const checkInternet = async () => {
  const isConnected = await isDeviceConnectedToInternet();

  if (isConnected) {
    console.log('Device is connected to the internet');
  } else {
    console.log('Device is not connected to the internet');
  }
};

// Call checkInternet() when needed