I have a react native app to connect the mobile to hotspot and make api calls the issue is it works properly on android but gives error on ios here is the error : nw_proto_tcp_route_init [C5.1.1.1:3] no mtu received
nw_endpoint_flow_failed_with_error [C27.1.1 dry-run 18.161.216.45:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_proto_tcp_route_init [C7.1.1.1:3] no mtu received
nw_connection_add_timestamp_locked_on_nw_queue [C7] Hit maximum timestamp count, will start dropping events
nw_endpoint_flow_failed_with_error [C28.1.1 dry-run 142.250.67.42:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_proto_tcp_route_init [C10.1.1.1:3] no mtu received
nw_connection_add_timestamp_locked_on_nw_queue [C19] Hit maximum timestamp count, will start dropping events
nw_connection_add_timestamp_locked_on_nw_queue [C15] Hit maximum timestamp count, will start dropping events
nw_endpoint_flow_failed_with_error [C24.1.1 dry-run 142.250.182.138:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_endpoint_flow_failed_with_error [C31.1.1 dry-run 142.250.182.46:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_proto_tcp_route_init [C8.1.1.1:3] no mtu received
nw_endpoint_flow_failed_with_error [C25.1.1 dry-run 142.250.182.10:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_proto_tcp_route_init [C12.1.1.1:3] no mtu received
nw_endpoint_flow_failed_with_error [C32 dry-run 142.250.67.42:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_endpoint_flow_failed_with_error [C30.1.1 dry-run 142.250.67.42:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_endpoint_flow_failed_with_error [C26.1.1 dry-run 34.211.172.20:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_proto_tcp_route_init [C19.1.1.1:3] no mtu received
nw_endpoint_flow_failed_with_error [C29.1.1 dry-run 142.250.205.234:443 ready socket-flow (unsatisfied (No network route))] already failing, returning
nw_connection_add_timestamp_locked_on_nw_queue [C11] Hit maximum timestamp count, will start dropping events
nw_proto_tcp_route_init [C11.1.1.18:3] no mtu received
Connection 5: encountered error(1:53)
Connection 7: encountered error(1:53)
Connection 10: encountered error(1:53)
nw_read_request_report [C15] Receive failed with error "Socket is not connected"
nw_read_request_report [C15] Receive failed with error "Socket is not connected"
Connection 8: encountered error(1:53)
Connection 12: encountered error(1:53)
Connection 19: encountered error(1:53)
Connection 11: encountered error(1:53)
Connection 33: received failure notification
Connection 33: failed to connect 1:50, reason -1
Connection 33: encountered error(1:50)
Task <E844CB16-AA1D-4202-9F1A-09398718FEBD>.<19> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
Task <E844CB16-AA1D-4202-9F1A-09398718FEBD>.<19> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x3035a6220 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <E844CB16-AA1D-4202-9F1A-09398718FEBD>.<19>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <E844CB16-AA1D-4202-9F1A-09398718FEBD>.<19>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=http://192.168.4.1:8080/wifi/ap/scan, NSErrorFailingURLKey=http://192.168.4.1:8080/wifi/ap/scan, _kCFStreamErrorDomainKey=1}
Connection 34: received failure notification
Connection 34: failed to connect 1:50, reason -1
Connection 34: encountered error(1:50)
Task <D72409FE-13A7-4C3E-8B01-86C5B360BD8B>.<20> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
Task <D72409FE-13A7-4C3E-8B01-86C5B360BD8B>.<20> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x3035a7360 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (Local network prohibited), interface: en0[802.11], ipv4, uses wifi, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D72409FE-13A7-4C3E-8B01-86C5B360BD8B>.<20>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <D72409FE-13A7-4C3E-8B01-86C5B360BD8B>.<20>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=http://192.168.10.1/config/wlan/scan, NSErrorFailingURLKey=http://192.168.10.1/config/wlan/scan, _kCFStreamErrorDomainKey=1} and here is the code : import React, {useContext, useState} from "react";
import {Platform, ScrollView} from "react-native";

import {StackScreenProps} from "@react-navigation/stack";

import Alert from "@components/alert";
import Background from "@components/background";
import Label from "@components/label";
import Button from "@components/primaryButton";

import {DEFAULT_INITIAL_ALERT_STATUS} from "@config/constants/AppConstants";
import {IOS_LOCAL_NETWORK_CHECK_ASYNC_STORAGE_KEY} from "@config/constants/DaikinLiteConstants";
import {DeviceType} from "@config/constants/DeviceTypeConstants";
import {HomeNavigatorParamList} from "@config/constants/NavConstants";
import {PermissionStatus} from "@config/constants/PermissionConstants";
import {ALTHERMA_SSID} from "@config/constants/ThermostatConstants";
import {IOS_LOCAL_NETWORK_TIMEOUT} from "@config/constants/TimeoutConstants";
import {translationKeys} from "@config/constants/TranslationConstants";
import {getLocalizationContext} from "@config/Translations";
import {iAlertState} from "@config/types/CommonTypes";

import localStorage from "@services/asyncStorage";
import {useAppDispatch} from "@store/Hooks";
import {
	hideLoader as hideFanLoader,
	showLoader as showFanLoader,
} from "@store/loader/LoaderSlice";
import * as miniThermostatThunkActions from "@store/miniThermostat/ThunkActions";
import {disableAppStateListener} from "@store/settings/SettingsSlice";

import Page from "@styles/Page";
import {useThemeAwareObject} from "@styles/theming/ThemingHelper";
import {
	checkForLocationPermission,
	triggerAndroidLocationPermissionPopUp,
} from "@utils/LocationPermissionUtil";
import {checkAndConnectToWifiSSID} from "@utils/WifiManagerUtils";

import Styles from "./Styles";

type Props = StackScreenProps<
	HomeNavigatorParamList,
	"AlthermaInitialStepScreen"
>;

const AlthermaInitialStepScreen = ({navigation}: Props) => {
	const {translate} = useContext(getLocalizationContext());

	const styles = useThemeAwareObject(Styles.createStyles);

	const dispatch = useAppDispatch();

	const [alertStatus, setAlertStatus] = useState<iAlertState>(
		DEFAULT_INITIAL_ALERT_STATUS,
	);

	const showLoader = (loading: boolean) => {
		if (loading) {
			dispatch(showFanLoader());
		} else {
			dispatch(hideFanLoader({className: "AlthermaInitialStepScreen"}));
		}
	};

	const onDismissAlert = () => {
		setAlertStatus({
			isVisible: false,
			title: alertStatus.title,
			message: alertStatus.message,
			positiveBtnLabel: alertStatus.positiveBtnLabel,
			negativeBtnLabel: alertStatus.negativeBtnLabel,
			onPress: null,
			onCancel: null,
		});
	};

	const onNavigate = () => {
		showLoader(false);
		navigation.navigate("AlthermaAPIsTestScreen");
	};

	const onNavigateBack = () => {
		onDismissAlert();
	};

	const onNavigateToConfigureThermostatScreen = () => {
		onDismissAlert();
		navigation.navigate("ConfigureThermostatScreen", {
			deviceType: DeviceType.altherma,
			ssidPrefix: ALTHERMA_SSID,
			password: "T3GQ0K4Q" as string,
		});
	};

	const showAndroidLocationPermissionPopUp = async () => {
		const {status} = await triggerAndroidLocationPermissionPopUp(
			setAlertStatus,
			onDismissAlert,
		);
		if (status === PermissionStatus.granted) {
			getWifiSSID();
		}
	};

	const onNavigateBasedOnPlatform = async () => {
		const localNetworkPermissionChecked = await localStorage.getItem(
			IOS_LOCAL_NETWORK_CHECK_ASYNC_STORAGE_KEY,
		);
		if (
			Platform.OS === "ios" &&
			(localNetworkPermissionChecked === null ||
				JSON.parse(localNetworkPermissionChecked) === false)
		) {
			const response = await dispatch(miniThermostatThunkActions.getWifiList());
			if (response.meta.requestStatus === "rejected") {
				await localStorage.setItem(
					IOS_LOCAL_NETWORK_CHECK_ASYNC_STORAGE_KEY,
					JSON.stringify(true),
				);
				setTimeout(() => {
					onNavigate();
				}, IOS_LOCAL_NETWORK_TIMEOUT);
			} else {
				onNavigate();
			}
		} else {
			onNavigate();
		}
	};

	const getWifiSSID = async () => {
		const isConnected = await checkAndConnectToWifiSSID(
			ALTHERMA_SSID,
			"T3GQ0K4Q" as string,
			setAlertStatus,
			onDismissAlert,
			showLoader,
			true,
			onNavigate,
			onNavigateBack,
			onNavigateToConfigureThermostatScreen,
		);
		if (isConnected) {
			await onNavigateBasedOnPlatform();
		}
	};

	const connectToHotspot = async () => {
		dispatch(disableAppStateListener());
		const {status} = await checkForLocationPermission(
			setAlertStatus,
			onDismissAlert,
		);
		if (Platform.OS === "android") {
			if (status === PermissionStatus.granted) {
				showAndroidLocationPermissionPopUp();
			}
		} else if (Platform.OS === "ios") {
			if (status === PermissionStatus.granted) {
				getWifiSSID();
			}
		}
	};

	return (
		<Background>
			<Alert
				visible={alertStatus.isVisible}
				title={alertStatus.title}
				description={alertStatus.message}
				positiveButtonTitle={
					alertStatus.positiveBtnLabel ||
					translate(translationKeys.alert.okayButtonLabel)
				}
				negativeButtonTitle={alertStatus.negativeBtnLabel}
				onPress={alertStatus.onPress || onDismissAlert}
				onCancel={alertStatus.onCancel || onDismissAlert}
				isWifiEnableAlert={alertStatus.isWifiEnableAlert}
			/>
			<ScrollView style={Page.container}>
				<Label
					text="Once your Thermostat is in AP Mode click the Continue button and provide all
                    the required permissions in order to navigate to the next screen. "
					style={styles.description}
				/>
				<Button
					title={translate(translationKeys.buttonTitle.continue)}
					style={[styles.nextButton]}
					onPress={connectToHotspot}
				/>
			</ScrollView>
		</Background>
	);
};

export default AlthermaInitialStepScreen; and import React, {useContext, useEffect, useState} from "react";
import {ScrollView, Text, View} from "react-native";

import {useNavigationState} from "@react-navigation/native";
import {StackScreenProps} from "@react-navigation/stack";

import Alert from "@components/alert";
import Background from "@components/background";
// import DaikinLiteWifiAlert from "@components/daikinLiteWifiStateAlert";
import Icon from "@components/icon";
import Label from "@components/label";
import Button from "@components/primaryButton";

import {DEFAULT_INITIAL_ALERT_STATUS} from "@config/constants/AppConstants";
import {HomeNavigatorParamList} from "@config/constants/NavConstants";
import {ALTHERMA_SSID} from "@config/constants/ThermostatConstants";
import {MINI_SPLIT_CONNECT_TIMEOUT} from "@config/constants/TimeoutConstants";
import {translationKeys} from "@config/constants/TranslationConstants";
import Images from "@config/Images";
import {getLocalizationContext} from "@config/Translations";
import {iAlertState} from "@config/types/CommonTypes";

import {althermaService} from "@services/api/altherma";
import {useAppDispatch} from "@store/Hooks";
import {
	hideLoader as hideFanLoader,
	showLoader as showFanLoader,
} from "@store/loader/LoaderSlice";

// import Page from "@styles/Page";
import {useThemeAwareObject} from "@styles/theming/ThemingHelper";
import {isConnectedToSSIDPrefix, timeout} from "@utils/WifiManagerUtils";

import {iWLANSettings} from "config/types/AppDataTypes/AlthermaTypes";

import Styles from "./Styles";

type Props = StackScreenProps<HomeNavigatorParamList, "AlthermaAPIsTestScreen">;

const AlthermaAPIsTestScreen = ({navigation}: Props) => {
	const {translate} = useContext(getLocalizationContext());
	const styles = useThemeAwareObject(Styles.createStyles);

	const dispatch = useAppDispatch();
	const routes = useNavigationState((state) => {
		return state.routes;
	});

	const [alertStatus, setAlertStatus] = useState<iAlertState>(
		DEFAULT_INITIAL_ALERT_STATUS,
	);

	const [apiResponse, setApiResponse] = useState<string>("");

	const closeButton = () => {
		return (
			<Icon
				Image={Images.svgIcons.crossButton}
				color={styles.crossIcon.color}
				onPress={async () => {
					await reboot();
				}}
			/>
		);
	};

	useEffect(() => {
		navigation.setOptions({
			headerLeft: (): JSX.Element => {
				return closeButton();
			},
		});
	}, []);

	const showLoader = (loading: boolean) => {
		if (loading) {
			dispatch(showFanLoader());
		} else {
			dispatch(hideFanLoader({className: "AlthermaAPIsTestScreen"}));
		}
	};

	// Handler for Scan API
	const runScanApi = async () => {
		showLoader(true);
		try {
			const result = await althermaService.scanWifiNetworks();
			if ("error" in result && result.error) {
				setApiResponse(`Error: ${JSON.stringify(result.error)}`);
			} else {
				setApiResponse(`Success: ${JSON.stringify(result.data)}`);
			}
		} catch (error: any) {
			setApiResponse(`Exception: ${error.message}`);
		} finally {
			showLoader(false);
		}
	};

	// Handler for Networks API
	const runNetworksApi = async () => {
		showLoader(true);
		try {
			const result = await althermaService.getAvailableNetworks();
			if ("error" in result && result.error) {
				setApiResponse(`Error: ${JSON.stringify(result.error)}`);
			} else {
				setApiResponse(`Success: ${JSON.stringify(result.data)}`);
			}
		} catch (error: any) {
			setApiResponse(`Exception: ${error.message}`);
		} finally {
			showLoader(false);
		}
	};

	// Handler for Settings API
	const runSettingsApi = async () => {
		showLoader(true);
		try {
			// Define your settings here. Replace with actual settings as needed.
			const settings: iWLANSettings = {
				// Example settings
				ssid: "Hathway_Ashish2.4G",
				security: "WPA_WPA2_MIXED",
				key: "8296494290",
			};
			const result = await althermaService.configureWifiConnection(settings);
			if ("error" in result && result.error) {
				setApiResponse(`Error: ${JSON.stringify(result.error)}`);
			} else {
				setApiResponse(`Success: ${JSON.stringify(result.data)}`);
			}
		} catch (error: any) {
			setApiResponse(`Exception: ${error.message}`);
		} finally {
			showLoader(false);
		}
	};

	// Handler for Info API
	const runInfoApi = async () => {
		showLoader(true);
		try {
			const result = await althermaService.getWlanInfo();
			if ("error" in result && result.error) {
				setApiResponse(`Error: ${JSON.stringify(result.error)}`);
			} else {
				setApiResponse(`Success: ${JSON.stringify(result.data)}`);
			}
		} catch (error: any) {
			setApiResponse(`Exception: ${error.message}`);
		} finally {
			showLoader(false);
		}
	};

	const navigateBack = () => {
		showLoader(false);
		const filteredRoutes = routes.filter((item) => {
			return item.name === "ConfigureThermostatScreen";
		});
		if (filteredRoutes.length > 0) {
			navigation.pop(1);
		}
		navigation.goBack();
	};

	const reboot = async () => {
		showLoader(true);
		/**
		 * Check if still connected to thermostat hotspot
		 * If yes call reboot api, we won't check for status because irrespective of the result we need to take user back
		 * If not then just navigate back
		 */
		const isConnectedToMiniSplitSSID =
			await isConnectedToSSIDPrefix(ALTHERMA_SSID);
		if (isConnectedToMiniSplitSSID.isConnected) {
			// await rebootAdapter();
			await timeout(MINI_SPLIT_CONNECT_TIMEOUT);
			navigateBack();
		} else {
			navigateBack();
		}
	};

	const onDismissAlert = () => {
		// setIsFetchingWifiList(false);
		setAlertStatus({
			isVisible: false,
			buttonAlignment: alertStatus.buttonAlignment,
			title: alertStatus.title,
			message: alertStatus.message,
			positiveBtnLabel: alertStatus.positiveBtnLabel,
			negativeBtnLabel: alertStatus.negativeBtnLabel,
			onPress: null,
			onCancel: null,
		});
	};

	return (
		<Background style={styles.root}>
			<View style={styles.container}>
				{/* <DaikinLiteWifiAlert
					ssidPrefix={ALTHERMA_SSID}
					navigation={navigation}
				/> */}
				<Alert
					visible={alertStatus.isVisible}
					title={alertStatus.title}
					buttonAlignment={alertStatus.buttonAlignment}
					description={alertStatus.message}
					positiveButtonTitle={
						alertStatus.positiveBtnLabel ||
						translate(translationKeys.alert.okayButtonLabel)
					}
					negativeButtonTitle={alertStatus.negativeBtnLabel}
					alternateButtonTitle={alertStatus.alternativeBtnLabel}
					onPress={alertStatus.onPress || onDismissAlert}
					onCancel={alertStatus.onCancel || onDismissAlert}
					onPressAlternate={alertStatus.onPressAlternate || onDismissAlert}
				/>
				<Label
					text="Click on the buttons below to check the Altherma APIs"
					style={styles.description}
				/>

				<Button
					title="Run Scan API"
					style={[styles.scanButton]}
					onPress={runScanApi}
				/>
				<Button
					title="Run Networks API"
					style={[styles.scanButton]}
					onPress={runNetworksApi}
				/>
				<Button
					title="Run Settings API"
					style={[styles.scanButton]}
					onPress={runSettingsApi}
				/>
				<Button
					title="Run Info API"
					style={[styles.scanButton]}
					onPress={runInfoApi}
				/>
				<View style={styles.responseWrapper}>
					<ScrollView
						style={styles.responseContainer}
						contentContainerStyle={{flexGrow: 1}}
					>
						<Text style={styles.responseText}>
							{apiResponse ||
								"API response will appear herecjc \n cj cjlc c cj cjac cl scdhc hk."}
						</Text>
					</ScrollView>
				</View>
			</View>
		</Background>
	);
};

export default AlthermaAPIsTestScreen; how to fix this also note that I have already added NSLocalNetworkUsageDescription to the info.plist and accepted the permission on iphone 14