diff --git a/README.md b/README.md index b9e47cfd..ca7fbf73 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,7 @@ Handful of utilities you should keep in your toolbelt to handle offline/online connectivity in React Native. It supports iOS, Android and Windows platforms. You can leverage all the functionalities provided or just the ones that suits your needs, the modules are conveniently decoupled. ## Important (Please read) -**This is the documentation for version 4.0.0-beta.2. If you are migrating from v3 to v4, check the [release notes](https://github.com/rgommezz/react-native-offline/releases/tag/v4.0.0-beta.0)** - -Please try to use v4. Some of the core has been rewritten from scratch using TDD approach and it fixes some of the outstanding [issues](https://github.com/rgommezz/react-native-offline/pull/141) that v3 presented. If you are using RN v0.56 or higher v3 won't work. Don't be misled by the word *beta*, it's a precaution measure that I've set myself because I am human and I may have made some unwitting mistake :robot:. It'd be appreciated to gather feedback early on to draft the final *stable* release. Also, an example application is coming soon to better illustrate real case scenarios of usage of the library. **Check out the [installation details](#installation).** - -That being said, if you still want to use v3, go [here](./docs_3x.md). +**This is the documentation for version 4.0.0. If you are migrating from v3 to v4, check the [release notes](https://github.com/rgommezz/react-native-offline/releases/tag/v4.0.0).** ## Contents @@ -75,7 +71,7 @@ This gives you the power to prioritize our work and support the project contribu ## Installation This library supports React Native v0.55 or higher. ``` -$ yarn add react-native-offline@4.0.0-beta.2 +$ yarn add react-native-offline@4.0.0 ``` #### Android @@ -455,7 +451,9 @@ async function internetChecker(dispatch) { ### FAQ #### How to test offline behavior while actually being online -You can use `pingServerUrl` and set it to a non existing url or point to some server that is down. +You can use `pingServerUrl` and set it to a non existing url or point to some server that is down. Don't forget to also set `shouldPing` to `true` (which is the default behaviour). + +Don't rely too much on iOS simulators and switching on/off the internet connection on your computer, they are quite buggy and report inconsistent connectivity information. On the other hand, testing on real devices should be fine. #### How to orchestrate Redux to dispatch `CONNECTION_CHANGE` as the first action when the app starts up The solution involves using some local state in your top most component and tweaking the `configureStore` function a bit, so that it can notify your root React component to render the whole application when the required initialisation has taken place. In this case, by initialisation, we are talking about rehydrating the store from disk and detecting initial internet connection. diff --git a/package.json b/package.json index 6acb868a..5be9e294 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-offline", - "version": "4.0.0-beta.2", + "version": "4.0.0", "description": "Handy toolbelt to deal with offline mode in React Native applications. Cross-platform, provides a smooth redux integration.", "main": "./src/index.js", "author": "Raul Gomez Acuña (https://github.com/rgommezz)",