Giter VIP home page Giter VIP logo

wrathchaos / react-native-internet-connection-alert Goto Github PK

View Code? Open in Web Editor NEW
80.0 4.0 13.0 27.56 MB

Fully customizable internet connection listener with the built-in alert for React Native

Home Page: https://freakycoder.com

JavaScript 8.58% Starlark 1.49% Java 37.63% Ruby 3.13% Objective-C 5.88% TypeScript 13.02% Makefile 3.76% C++ 17.18% Objective-C++ 8.99% Shell 0.34%
react-native react javascript internet connection internet-connection network alert listener internet-listener

react-native-internet-connection-alert's Introduction

React Native Internet Connection Alert

Battle Tested โœ…

Fully customizable internet connection connection with built-in alert for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

React Native Internet Connection Alert

React Native Internet Connection Alert React Native Internet Connection Alert

Installation

Add the dependency:

npm i react-native-internet-connection-alert

Peer Dependencies

IMPORTANT! You need install them
"react-native-dropdownalert": "=> 4.5.1",
"@react-native-community/netinfo": "=> 8.3.0"

Usage

Import

import InternetConnectionAlert from "react-native-internet-connection-alert";

Fundamental Usage

I strongly suggest that cover whole application with InternetConnectionAlert component it will handle itself and be able to shows the built-in alert on your whole application. Otherwise, just cover the screen where you need to use this library.

<InternetConnectionAlert
  onChange={(connectionState) => {
    console.log("Connection State: ", connectionState);
  }}
>
  {/* {... Your whole application should be here ... } */}
</InternetConnectionAlert>

Configuration - Props

Property Type Default Description
onChange function undefined if you need the connection state when it is changed, you can use this function
type DropdownAlertType error Use some of the prepared dropdown types or if you want to use your own customization set 'custom'
title string Internet Connection Problem to change the title of built-in alert
message string Please check your network connection to change the message of built-in alert
useInternetReachability boolean false to change the check for connection state to use internet reachability

Everything is customizable on built-in dropdownalert. Simply please look at the React Native Dropdown Alert

Future Plans

  • LICENSE
  • Write an article about the lib on Medium

Author

FreakyCoder, [email protected]

License

React Native Internet Connection Alert is available under the MIT license. See the LICENSE file for more info.

react-native-internet-connection-alert's People

Contributors

mohzameer avatar wrathchaos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-native-internet-connection-alert's Issues

error on install

I'm getting this error while trying to install with the command npm i react-native-internet-connection-alert

Invalid tag name "=> 5.9.6": Tags may not have any characters that encodeURIComponent encodes

i've already installed dependencies. What is going on here?

in IOS it still stuck on top if internet back to online

this is my app.js code

 return (
    <SafeAreaProvider>
      <CustomStatusBar backgroundColor="#5CA2E2" />
    <InternetConnectionAlert
      onChange={connectionState => {
        // console.log("Connection State: ", connectionState)
      }}>
        
      <Provider store={store}>
        <NavigationContainer>
          <HomeStackNavigation />
          <Toast />
        </NavigationContainer>
      </Provider>
    </InternetConnectionAlert>
    </SafeAreaProvider>
  );

Dependencies

"react-native-internet-connection-alert": "^0.1.7",
"react-native-dropdownalert": "4.5.1",
@react-native-community/netinfo": "8.0.0",

on android above 10 version, it works fine but below 9 it stuck on top even after the internet is back to online

isInternetReachable

Can you add a check for isInternetReachable and not only isConnected?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.