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

refactor(ios): handle deprecation of CNCopyCurrentNetworkInfo #150

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

daadu
Copy link
Member

@daadu daadu commented May 16, 2021

Using NEHotspotNetwork.fetchCurrent instead

Closes #142 #105 #75 #121

@daadu daadu changed the title refactor(ios): handle deprecation of CNCopySupportedInterfaces refactor(ios): handle deprecation of CNCopyCurrentNetworkInfo May 16, 2021
Using `NEHotspotNetwork.fetchCurrent` instead
@Niek
Copy link
Contributor

Niek commented May 17, 2021

Awesome, I can't test right now but this is great work.

@diegotori
Copy link

LGTM. Hopefully, we'll see a new release shortly thereafter.

@phan-dev
Copy link

@daadu I got this message on both iOS real device and simulator

[] NEHotspotNetwork nehelper sent invalid result code [1] for Wi-Fi information request

@daadu
Copy link
Member Author

daadu commented Jun 16, 2021

@daadu I got this message on both iOS real device and simulator

[] NEHotspotNetwork nehelper sent invalid result code [1] for Wi-Fi information request

@phan-dev Just confirming - did you add "Network Extension" to the iOS proj? Can you tell iOS version you tested on?

@phan-dev
Copy link

image

@daadu tested on real device - iOS 14.4.2 and simulator - iOS 14.5

@daadu
Copy link
Member Author

daadu commented Jun 16, 2021

I don't have iOS 14 devices, have not tested it personally.

Will test it myself in some days

@diegotori
Copy link

diegotori commented Jun 17, 2021

@phan-dev In addition to the info of this link, you need to make sure that your App ID has the following capabilities enabled:

  • Access WiFi Information
  • Hotspot
  • Network Extensions
  • Wireless Accessory Configuration

Also, ensure that your entitlements file contains the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.developer.networking.HotspotConfiguration</key>
	<true/>
	<key>com.apple.developer.networking.networkextension</key>
	<array>
		<string>app-proxy-provider</string>
	</array>
	<key>com.apple.developer.networking.wifi-info</key>
	<true/>
	<key>com.apple.external-accessory.wireless-configuration</key>
	<true/>
</dict>
</plist>

@diegotori
Copy link

@phan-dev also, this Apple Dev Forum post has a working example of the bare minimum needed to connect to a WiFi Network for iOS 14 and higher along with the necessary entitlements to use and the plist entries to make.

@diegotori
Copy link

@daadu any updates?

@daadu daadu merged commit dc7e437 into master Jul 9, 2021
@daadu daadu deleted the ios-handle-deprecation branch July 9, 2021 05:49
daadu added a commit that referenced this pull request Jul 9, 2021
daadu added a commit that referenced this pull request Jul 9, 2021
@daadu
Copy link
Member Author

daadu commented Jul 9, 2021

This has landed on pub.dev with v0.3.4.

@daadu
Copy link
Member Author

daadu commented Jul 9, 2021

@diegotori Took long because was not sure if it was tested well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants