-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #107
- Loading branch information
Showing
1 changed file
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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-beta.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 [email protected]-beta.2 | ||
$ yarn add [email protected] | ||
``` | ||
|
||
#### 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. | ||
|