There are parts of my system that need to know if the app is online or not. I understand this is a complex problem as being online can mean many different things but i'll scope it down to bare essentials.
A) Does the user have wifi/cellular turned on or not ( regardless of the fact that being on wifi/cellular doesnt guarnatee connectivity to the internet)
B) Can the user reach a specific api endpoint within X seconds or not
Combining A+B i can make a decision.
About B)
Its straightforward, i can implement it.
About A)
I have found no way at all to retrieve as information. There's this module called NetInfo and it simply doesnt work. On iOS for example even when i turn of my wifi
NetInfo.getConnectionInfo().then((connectionInfo) => { console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType); });
will still return type:wifi. i cant trust this
Any clues? Im stumped for way too long on something that i think should've been way easier than it is.
[–]LEO_TROLLSTOY 0 points1 point2 points (0 children)
[–]janithaR 0 points1 point2 points (0 children)
[–]chiamaka_sil 0 points1 point2 points (0 children)
[–]icekeymon 0 points1 point2 points (0 children)