zoukankan      html  css  js  c++  java
  • 获取wifi热点

    https://stackoverflow.com/questions/31555640/how-to-get-wifi-ssid-in-ios9-after-captivenetwork-is-deprecated-and-calls-for-wi

    Register your app as Hotspot helper.

    #import <NetworkExtension/NetworkExtension.h>  
    
    NSArray * networkInterfaces = [NEHotspotHelper supportedNetworkInterfaces];  
    NSLog(@"Networks %@",networkInterfaces);

    UPDATE (Sept. 11th, 2015)

    The following Captive Network APIs have been re-enabled in the latest version of iOS 9 instead.

    • CNCopySupportedInterfaces
    • CNCopyCurrentNetworkInfo

    UPDATE (Sept. 16th, 2015)

    If you still prefer to use NetworkExtension and Apple gave you permission to add the entitlements, then you can do this to get the wifi information:

    for(NEHotspotNetwork *hotspotNetwork in [NEHotspotHelper supportedNetworkInterfaces]) {
        NSString *ssid = hotspotNetwork.SSID;
        NSString *bssid = hotspotNetwork.BSSID;
        BOOL secure = hotspotNetwork.secure;
        BOOL autoJoined = hotspotNetwork.autoJoined;
        double signalStrength = hotspotNetwork.signalStrength;
    }

    NetworkExtension provides you some extra information as secure, auto joined or the signal strength. And it also allows you to set credential to wifis on background mode, when the user scans wifis around.

  • 相关阅读:
    Java 原理性文章收录
    kafka connect userguide【confluence】
    curl 工具使用
    MySQL 数据类型
    Kafka Producer (0.10.0.0)原理
    Kafka Consumer 原理与实践
    java 泛型详解
    redis 高可用集群之水平扩展
    Redis 5.0.0 安装(集群)
    Apollo(阿波罗)架构深度剖析
  • 原文地址:https://www.cnblogs.com/apem/p/6894763.html
Copyright © 2011-2022 走看看