iOS SDK
Wi-Fi Configuration
AP Configuration

AP Provisioning

timeout is in seconds: 60 means 60 seconds. bindWithUid is nullable but has no default argument, so it must be supplied explicitly.

AI module requirement: when an AI module establishes its own binding relationship with the cloud, SDK provisioning must set bindWithUid = true. Sign in first, or supply a valid uid and token. This mode uses the current user’s bound-device list to confirm provisioning. Pass false for ordinary provisioning. The flag does not replace sign-in or mean that the app calls the device’s bind() method.

Connect the phone to the device’s AP hotspot, then provision the discovered LAN device.

The return type is GizResult<GizBaseProfile?, GizActivatorException?>. Read module information from the capability’s deviceProfile property. netStatus is an enum.

import GizwitsiOSSDK
 
// Run in a Task or async function; use true when the AI module binds itself in the cloud
let bindWithUid = true
let capability = device.lanCapability
if capability.isOnline {
    let result = await capability.provideWiFiCredentials(
        ssid: ssid,
        password: password,
        timeout: 60,
        processHandler: { event in print(event) },
        bindWithUid: bindWithUid
    )
    if let error = result.error ?? nil, error == .GIZ_SDK_DEVICE_CONFIG_TIMEOUT {
        print("Timeout")
    }
    if result.success, let configuredDevice = result.data ?? nil {
        print(configuredDevice.mac)
    }
}

Stop Provisioning

let stopResult = await device.lanCapability.stopProvideWiFiCredentials()