I'm developing an iOS app using Ionic (JavaScript Framework) and I'm connecting to an Iot device and sending a fetch request to it.
If my phone doesn't have a cellular connection, the fetch fails.
This is the process:
Turn on Iot device
Use app to connect to device access point
Send fetch request to device
try {
const response = await fetch('http://192.168.1.1/');
// handle response
} catch(err) {
console.log(err);
// handle error
}
Fetch fails
Is there a way for the fetch to work when connected to an access point without internet? Are there any other libraries that might help me achieve this?