Check internet availability in the app

I want to be able to instantly check if the user has internet access. Without using the network native plugin, like if i click a button check if there’s internet and return the status, whether true or false.

Maybe this is what you are looking for, but it is not supported by safari:

I just decided to go with the native and use network.type, I wasn’t sure of it cause it showed null when i was using ionic serve on my chrome, so was thinking it has an issue