Allow startNotifier to optionally skip the initial check. #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because sometimes you only want to know when network comes back.
Furthermore, the initial check is not on main thread which can cause some
issues for clients.
Certainly we needed this change to get rid of nasty crashes and difficult thread timing behaviour in our app. In our use case we only cared to know when connectivity was re-established for auto-reload functionality. So we didn't want to initial check, and occasionally the initial callback would arrive before the result of startNotifier had actually been assigned, so we didn't have access to the Reachability object (which we wanted to check if we had WiFi or mobile access). Which caused crashes until we figured out what was going on.