Distinguish between Wi-Fi and data connection on mobiles

Hello,

I want to determine whether the device running my app is connected to the internet via Wi-Fi or data carrier. The crucial point is that I want to distinguish between Wi-Fi and data carrier. The Application.internetReachability variable seemed to be just what I want. Unfortunately it doesn’t register any changes after the application’s initial startup. I testet this on an Android device, started the application while being connected via Wi-Fi and got the correct value. Then I disabled Wi-Fi and checked again but the value did not change. Can somebody confirm this? Is it a (known) Unity bug?

I do not see any other way to check which kind of network connection exists. I do not want to check for general internet availability but rather distinguish between Wi-Fi and data.

Any help would be much appreciated.

EDITED: Tried to make it clearer, what my goal was and optimized the title.

Hi sdnj,

The way I work around this problem is to check in a different way. All of my apps have Google play games functionality and on start up I check to see if the player signed in. If so the there is Wifi, so I set my bool to true and if not it returns false. Here’s my code for this.

Social.localUser.Authenticate((bool success) =>
		                              {
			if (success)
			{
				StartCoroutine(ShowMessage("Login Successful", 2));
				unlocksigninachievo();
				PlayerPrefs.SetInt("wifistate", 1);
			}
			else
			{
				PlayerPrefs.SetInt("wifistate", 0);
				StartCoroutine(ShowMessage("Login Failed", 3));
			}
		
		});


int state3 = PlayerPrefs.GetInt("wifistate", 0);
		if (state3 == 1)
			wifi = true;
		else
			wifi = false;

Hope This Helps

Cheers
Abbas