getWifiList(params: Object)

Requires:
BaseKit≥2.4.3@ray-js/ray≥0.5.9
Platforms:
iOSAndroid
import { getWifiList } from '@ray-js/ray';

// Promise usage
try {
  const res = await getWifiList();
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get the list of Wi‑Fi networks near the phone; the list data is delivered via the onGetWifiList event. Note: On Android, location permission, Wi‑Fi state permission, and network permission are required; not available on iOS

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { getWifiList } from '@ray-js/ray'

getWifiList({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});