title: Getting WiFi name in Android 8.1?
body: <p>I want to get the name of connected WiFi in Android 8.1. When I get the SSID it returns "unknown ssid". Some answers on Stack-overflow say to get Location permissions. I even did that, but the issue persists.</p>
  
  <pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O_MR1) {
          if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
              return getString(R.string.grant_location_permission_wifi_name)
          }
      }
      val wifiInfo = mWifiManager.connectionInfo
      return wifiInfo.ssid
  </code></pre>