@devjay/rn-internet-connectivity-devjay

1.0.6 • Public • Published

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

Package Sidebar

Install

npm i @devjay/rn-internet-connectivity-devjay

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

1.99 kB

Total Files

3

Last publish

Collaborators

  • devjay