How to set an operator friendly name when configuring Wifi Network(s) on iOS (Hotspot 2.0/Passpoint specifically)?

Viewed 54

I have the following code to configure a hotspot 2.0 network profile and it works and auths as expected.

However, I know that this type of profile contains a friendly operator name property that should be allowed to be set.

The property name may differ but basically it is a property set as a display text when previewing your Wifi list in the device settings once a user auths.

Android has this property so my best assumption is that iOS (Swift) should too, as it's a standard for Passpoint/Hotspot 2.0 profiles.

// Configure profile
      let hotspotSettings = NEHotspotHS20Settings.init(domainName: result.domain, roamingEnabled: result.roaming)
      hotspotSettings.naiRealmNames = result.nai_realms
      hotspotSettings.roamingConsortiumOIs = result.roaming_ois
    
      print("SETTING123 : ", hotspotSettings)
      
      let hotspotEAPSettings = NEHotspotEAPSettings()
      hotspotEAPSettings.username = result.username
      hotspotEAPSettings.password = result.password
      hotspotEAPSettings.isTLSClientCertificateRequired = result.client_cert_required
      hotspotEAPSettings.supportedEAPTypes = result.eap_types
      hotspotEAPSettings.preferredTLSVersion = NEHotspotEAPSettings.TLSVersion(rawValue: Int(Double(1.2)))!
      hotspotEAPSettings.trustedServerNames = result.trusted_server_names
      hotspotEAPSettings.outerIdentity = result.outer_identity
      if(result.eap_inner_type == "mschapv2") {
        print("MSCHAP HERE")
        hotspotEAPSettings.ttlsInnerAuthenticationType = .eapttlsInnerAuthenticationMSCHAPv2
      }

      print("EAP SETTINGS123: ", hotspotEAPSettings)
    
      let hotspotConfig = NEHotspotConfiguration.init(hs20Settings: hotspotSettings, eapSettings: hotspotEAPSettings)
    
      let manager = NEHotspotConfigurationManager.shared;
    
        manager.apply(hotspotConfig) { (error) in
          print("Error 1: ",error?.localizedDescription as Any)
          print("Error 2: ", error as Any)
          if let error = error {
            print("Error: ", error)
            successCallback([false])
          } else {
            print("successfully installed ")
            successCallback([true])
          }
        }

Example profile for Android

The following subtree nodes are used under HomeSP:

FriendlyName: Must be set; used as display text
FQDN: Required
RoamingConsortiumOI
The following subtree nodes are used under Credential:

Realm: Must be a nonempty string
UsernamePassword: Required for EAP-TTLS with the following nodes set:

Username: String that contains the username
Password: Base64-encoded string (set to cGFzc3dvcmQ=, the base64-encoded string for "password", in the example below)
EAPMethod/EAPType: Must be set to 21
EAPMethod/InnerMethod: Must be set to one of PAP, CHAP, MS-CHAP, or MS-CHAP-V2
DigitalCertificate: Required for EAP-TLS. The following nodes must be set:

CertificateType set to x509v3

Top Swift classes used to configure and create a Passpoint profile: https://developer.apple.com/documentation/networkextension/nehotspoths20settings https://developer.apple.com/documentation/networkextension/nehotspoteapsettings https://developer.apple.com/documentation/networkextension/nehotspotconfiguration https://developer.apple.com/documentation/networkextension/nehotspotconfigurationmanager

0 Answers
Related