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

⚠ [ios] handle deprecation of CNCopyCurrentNetworkInfo #142

Closed
daadu opened this issue May 7, 2021 · 10 comments · Fixed by #150
Closed

⚠ [ios] handle deprecation of CNCopyCurrentNetworkInfo #142

daadu opened this issue May 7, 2021 · 10 comments · Fixed by #150
Labels
help wanted Extra attention is needed

Comments

@daadu
Copy link
Member

daadu commented May 7, 2021

  • getSSID, getBSSID for ios - should fail because of it
  • getSSID is internally used in handling isEnabled, connect, disconnect, those might be affected as well

Docs

@daadu daadu changed the title [ios] fix and improve getting current network info [ios] handle deprecation of CNCopyCurrentNetworkInfo May 16, 2021
@daadu daadu added the help wanted Extra attention is needed label May 16, 2021
@daadu daadu changed the title [ios] handle deprecation of CNCopyCurrentNetworkInfo ⚠ [ios] handle deprecation of CNCopyCurrentNetworkInfo May 16, 2021
@daadu
Copy link
Member Author

daadu commented May 16, 2021

CC: @fedepell @Niek @mavyfaby @alternadom

@daadu
Copy link
Member Author

daadu commented May 16, 2021

The recommended method to replace it is fetchCurrentWithCompletionHandler, this is part of HotspotHelper API which requires "special entitlements", to be requested from Apple manually here.

I have filled a similar issue to network_info_plus plugin at fluttercommunity/plus_plugins#240.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

Actions that we can take now:

  • remove dependencies of isConnected, connect and disconnect method on getSSID.

Need to be discussed:

  • Whether to implement, the fetchCurrentWithCompletionHandler or deprecate (add warning note in README) getSSID and getBSSID for iOS.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

This method could take time to be removed (assuming apple gives a breathing period for this, encourage anyone with iOS 14+ phone to test if it is not removed yet and if removed is there any side effect for connect and disconnect methods.). Anyways need to at least find ways to not use getSSID internally for other methods.

PS: I am not a native iOS developer and have not released any production iOS app before.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

Looks like fetchCurrentWithCompletionHandler does not require Hotspot Helper entitlement.

+fetchCurrentWithCompletionHandler: does not require the Hotspot Helper entitlement. Unfortunately that fact is not documented officially (r. 74976266). Fortunately, there’s lots of good info about this method in the doc comments in <NetworkExtension/NEHotspotNetwork.h>.

Share and Enjoy

from Official source in Apple forum - https://developer.apple.com/forums/thread/675211?answerId=664741022#664741022

@daadu
Copy link
Member Author

daadu commented May 16, 2021

This answer on SO has a possible solution.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

Good News: the NetworkInfo instance can provide signal strength, although the value is double from (0.0 to 1.0, lowest to highest), while in Android it is RSSI (which are values <0). Need to do additional calculate (and mention it in README) to bring it to parity.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

Additionally we can implement getIP too.

@daadu
Copy link
Member Author

daadu commented May 16, 2021

Filed the PR related to it, can someone with iOS 14 device test it?

@daadu
Copy link
Member Author

daadu commented Jul 9, 2021

The fix has landed on pub.dev with v0.3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant