Closed tirth-stasis closed 3 years ago
Hey @tirth-stasis
The thing about this plugin is that it replicates the features that TelephonyManager
provides. So you can just look up the docs for that to figure out if this is indeed what you need.
https://developer.android.com/reference/android/telephony/TelephonyManager#getDataState()
But I don't think this is the correct solution in your case. It actually makes sense that it returns WiFi because your mobile data is not connected at that point.
If you add a Network Callback to ConnectivityManager
on android you will see that once you connect to WiFi, the onLost
method is called with the connection id of you mobile data connection.
Let me check Network Callback.
But I don't think this is the correct solution in your case. It actually makes sense that it returns WiFi because your mobile data is not connected at that point.
Connectivity plugin return WiFi
whenever WiFi and Mobile Data both are on.
I want to detect whether android device is connected to the internet via mobile data or not. connectivity plugin doesn't help here because whenever WiFi and Mobile Data both are on, it return WiFi.
I want to know whether cellularDataState (https://shounakmulay.gitbook.io/telephony/network-data-and-metrics#cellulardatastate) method fulfilling my use-case and correct way of checking/detecting this.
Thanks.