Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: _networkInfo.getWifiBSSID() return value in different format; a "0" value is missing from the .getWifiBSSID() - iOS device only, Android working fine #2913

Open
8 tasks done
justatipfromthedeadsequoiatree opened this issue May 9, 2024 · 5 comments
Labels
bug Something isn't working triage

Comments

@justatipfromthedeadsequoiatree
Copy link

Platform

iOS Version 17.0.3 and iOS Version 17.4.1

Plugin

network_info_plus

Version

5.0.3

Flutter SDK

Flutter version 3.16.4 on channel stable

Steps to reproduce

when calling .getWifiBSSID() on iOS devices i got the output

53:12:32:11:e:b0

when calling .getWifiBSSID() on Android devices i got the output

53:12:32:11:0e:b0

as you can see, there is a missing "0" when i call .getWifiBSSID() on iOS devices. tested on iOS Version 17.0.3 and iOS Version 17.4.1

Related issue found

https://stackoverflow.com/q/4736718/7972633
https://superuser.com/q/133755

Code Sample

i have added some minimal reproduction code here

https://gist.github.com/justatipfromthedeadsequoiatree/a17a65f5be2a9117697d35eaee88a695

Logs

no log file

Flutter Doctor

[✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.1 23B81 darwin-arm64, locale
    en-GB)
    • Flutter version 3.16.4 on channel stable at
      /Users/xxxxx/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (5 months ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/xxxxx/Library/Android/sdk
    • Platform android-34, build-tools 33.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.89.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • XXXXX iPhone (mobile)   • 00008030-001C59191180802E • ios            • iOS 17.0.3 21A360
    • Nokia 3310 Gen 2 (mobile) • 00008120-001054422690201E • ios            • iOS 17.4.1 21E236
    • macOS (desktop)           • macos                     • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)              • chrome                    • web-javascript • Google Chrome 124.0.6367.119
    ! Error: Browsing on the local area network for siang’s iPhone (2). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@justatipfromthedeadsequoiatree justatipfromthedeadsequoiatree added bug Something isn't working triage labels May 9, 2024
@HiddenPulse
Copy link

Hi, any update on this?

@justatipfromthedeadsequoiatree
Copy link
Author

hi @miquelbeltran, could you help check on this issue? I'm quoting you because I saw that you were involved with this issues previously, thank you

@miquelbeltran
Copy link
Member

The plugin is basically passing up the BSSID value that Apple provides without modifying it.

Apple seems to be removing leading zeroes from the hex data.

I am not sure what the plugin can or should do about this, as it only passes data from one to the other.

@justatipfromthedeadsequoiatree
Copy link
Author

hi @miquelbeltran , thanks for the reply. After days of research and reading, I think the best approach for now would be to create a common function that adds the leading zeros to the BSSID value. thanks again

@miquelbeltran
Copy link
Member

If you end up implementing it, I think you can do a Pull Request with this function as an extension function for the BSSID method response, and more people from the community would benefit!

I would rather not modify the original methods, and still provide the data "as is", but as a "util" or extension function I think it can help.

Nevertheless, this difference in the data should be documented in the README as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants