How can I validate the internet connection


Hello everyone, I want to make an app that brings some data from the server, how can I verify that the cell phone has an internet connection in an effective way?

The question is why sometimes the device appears connected to the network but can not navigate

Thank you


If device is connected to a network but not internet, there is no direct api to validate that.

May be you can hit a website, could be google or your own server and see if that fails then you don’t have internet.


thanks for the answer, it can be a good option, is there any fuuncion, method or api that allows to see if the wifi is active?

It would be to validate that first and then review it by connecting to a server.

Thank you


Use to check if a network is active.