ashleymills / Reachability.swift

Replacement for Apple's Reachability re-written in Swift with closures
MIT License
7.94k stars 948 forks source link

Low connection detection #320

Closed Adelmaer closed 5 years ago

Adelmaer commented 5 years ago

I'm using the Reachability framework in my app to check if the device is online or offline.

It works fine to detect online/offline cases.

Except for these cases! The case when we have a poor internet connection or network is low (on 3g for example) or when we have the internet (3g) but the plan is not paid and it is doesn't send or receive anything, or when the user goes to a subway where the internet connection is extremely slow or when the WiFi is active but it doesn't work.

If we have such cases, framework returns connected state. But actually, this is not true.

Is there any way to detect such poor network or internet not available cases?

I'm using Xcode Version 10.0 (10A255), Swift 4

Panajev commented 5 years ago

Hey!

I found it best to use reachability to detect (mostly) if the device is connected to a network gateway that promises me access to what we think of as the Internet via essentially 3G/WWAN or WiFi. No guarantee beyond that (normally the reachability framework may do an initial connectivity check to the site you specify, but I think it is best not to treat the framework as a guarantee that you can always connect to the site in question or that it will respond).

If you need to check the actual service is actually online beyond handling errors to your regular requests you are normally expected to build your own logic on top of it.

Sent from my iPhone

On 25 Oct 2018, at 15:07, Adelmaer notifications@github.com wrote:

I'm using the Reachability framework in my app to check if the device is online or offline.

It works fine to detect online/offline cases.

Except for these cases! The case when we have a poor internet connection or network is low (on 3g for example) or when we have the internet (3g) but the plan is not paid and it is doesn't send or receive anything, or when the user goes to a subway where the internet connection is extremely slow or when the WiFi is active but it doesn't work.

If we have such cases, framework returns connected state. But actually, this is not true.

Is there any way to detect such poor network or internet not available cases?

I'm using Xcode Version 10.0 (10A255), Swift 4

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Adelmaer commented 5 years ago

Thanks