Is it possible to run a method that will return the name of the wireless network that the user is connected to? Inside of my app I want to be able to return the name of the wireless network that the user is connected to.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
This worked perfect for me:
From Developer.apple , you can use CNCopyCurrentNetworkInfo
It Returns the current network info for a given network interface.
It contains a dictionary that containing the interface’s current network info. Ownership follows the Create Rule.
Note:Available in iOS 4.1 and later.
EXAMPLE:
This example will work fine in real device, It may crash in simulator.
Add SystemConfiguration.framework
Import
CaptiveNetwork
header same as below#import <SystemConfiguration/CaptiveNetwork.h>
Then write the below code.
or
Using Bonjour, the application both advertises itself on the local network and displays a list of other instances of this application on the network
See the sample Witap application
The BAD NEWS: 'CNCopyCurrentNetworkInfo' is deprecated: first deprecated in iOS 9.0 - For captive network applications, this has been completely replaced by <NetworkExtension/NEHotspotHelper.h>. For other applications, there is no direct replacement. Please file a bug describing your use of this API to that we can consider your requirements as this situation evolves.
The GOOD NEWS: although deprecated, it still works in iOS 9, AND it has been un-deprecated in iOS 10.
It still works in iOS 13, but only if the app implements Location Services and the user authorizes their usage.