Fix iOS 17+ compatibility: Replace deprecated CNCopyCurrentNetworkInf…#144
Open
jainsuneet wants to merge 5 commits into
Open
Fix iOS 17+ compatibility: Replace deprecated CNCopyCurrentNetworkInf…#144jainsuneet wants to merge 5 commits into
jainsuneet wants to merge 5 commits into
Conversation
…o with NEHotspotNetwork - Replace deprecated CNCopyCurrentNetworkInfo API with NEHotspotNetwork.fetchCurrent for iOS 14+ - Add iOS version checks (@available) to use modern APIs on iOS 14+ while maintaining backward compatibility for iOS 11-13 - Trust NEHotspotConfigurationManager result directly on iOS 14+ (no post-connection verification needed) - Update getConnectedSSID() to use NEHotspotNetwork.fetchCurrentWithCompletionHandler on iOS 14+ - Update getConnectedBSSID() to use NEHotspotNetwork.fetchCurrentWithCompletionHandler on iOS 14+ - Add comprehensive logging to track iOS version detection and API usage - Add NSLocalNetworkUsageDescription entitlement requirement notes Fixes: 'nehelper sent invalid result code [1]' error on iOS 17+ The deprecated CNCopyCurrentNetworkInfo API returns null on iOS 17+ due to privacy restrictions. This update uses the modern NEHotspotNetwork API which is the Apple-recommended replacement. Breaking Change: None - maintains full backward compatibility with iOS 11-13
Fix iOS 17+ compatibility: Replace deprecated CNCopyCurrentNetworkInf…
Fixes compilation error: 'Variable is not assignable (missing __block type specifier)' In Objective-C, variables captured by blocks are read-only unless declared with __block. Added __block to pluginResult declarations in: - getConnectedSSID method - getConnectedBSSID method This allows the variable to be modified inside the NEHotspotNetwork completion handlers.
Merge pull request #1 from jainsuneet/fix/ios17-nehotspot-api
When user is already connected to the target network, iOS returns error code 13 (NEHotspotConfigurationErrorAlreadyAssociated). This should be treated as success, not failure. Changes: - Check error code 13 and return success with SSID - Updated both iOSConnectNetwork and iOSConnectOpenNetwork methods - Add specific logging for 'already connected' case Fixes issue where reconnecting to the same network throws an error instead of succeeding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…o with NEHotspotNetwork
Fixes: 'nehelper sent invalid result code [1]' error on iOS 17+
The deprecated CNCopyCurrentNetworkInfo API returns null on iOS 17+ due to privacy restrictions. This update uses the modern NEHotspotNetwork API which is the Apple-recommended replacement.
Breaking Change: None - maintains full backward compatibility with iOS 11-13
Requirements
Description of the Change
Alternate Designs
Why Should This Be In Core?
Benefits
Possible Drawbacks
Applicable Issues