question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getConnectedSSID() return unknown ssid in some mobile devices

See original GitHub issue

<!–

Have you read the plugins’ Code of Conduct? By creating an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/tripflex/wifiwizard2/blob/master/CODE_OF_CONDUCT.md

–>

Prerequisites

Check all boxes if you have done the following:

Issue type

Select all that apply

  • Bug
  • Enhancement
  • Task
  • Question
  • [] Other

Description

My customer reported that his android shows <unknown ssid> in app but I can’t reproduce it in my devices and emulator whatever android versions. Coincidently, I found some one post a blog that a similar issue for some mobile device - vivo x21iA / vivo x20.

I’ve tested in these two devices and the issue surely could be reproduced. It’s undoubtedly not the bug of plugin. It should be a bug of some firmwares or else, but I can’t tell my customers to contact the mobile manufacturer to solve this problem.

Thus, I have modified the code(WifiWizard2.java) as below(get SSID by another API):

      serviceInfo = info.getSSID();

      if(serviceInfo != null && serviceInfo.contains("unknown ssid")) {
          NetworkInfo wifiInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
          String wifiName = wifiInfo.getExtraInfo();
          if (wifiName.startsWith("\"")) {
              wifiName = wifiName.substring(1, wifiName.length());
          }
          if (wifiName.endsWith("\"")) {
              wifiName = wifiName.substring(0, wifiName.length() - 1);
          }
          serviceInfo = wifiName;
      }

And it works now. Hope this would help someone.

Versions

vivo x21iA / vivo x20 and maybe more Android 8.1 WifiWizard2 3.x

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
blondie63commented, Feb 17, 2019

Finally i’ve fixed my code ! I’ve uploaded a demo project here: https://github.com/blondie63/CheckWIFI

1reaction
luisAzcuagacommented, Dec 18, 2018

@gorebill You may wanna try calling WifiWizard2.requestPermission() manually. In your case info.requestPermission(). Experienced the same while using android 8.1+

Read more comments on GitHub >

github_iconTop Results From Across the Web

WiFi getSSID() always returns "<unknown ssid>"
A successful call to WifiManager.startScan() requires all of the following conditions to be met: • Your app has the ACCESS_FINE_LOCATION or ...
Read more >
Why is my WiFi network name displaying as <unknown ssid>?
Open Location; Tap App access to location then open IFTTT; Select Allow all the time. How to contact support or give feedback. Return...
Read more >
cordova-plugin-wifiwizard2-android10fix - npm
Native Ui show modal for connect one device to your Phone. ... WPA3"; isHiddenSSID boolean determine if is hidden or not; return boolean, ......
Read more >
WifiWizard2 | Ionic Documentation
Returns connected network SSID (only if connected) in success callback, ... when calling any android related methods that require WiFi to be enabled ......
Read more >
Test Net > SSID : return result Unknown SSID : r/tasker - Reddit
How to correct it or need more action with-in this task ? I checked the device is attached to my home SSID without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found