How to check if the device is connected Webview

I have a webview and when the internet is disconnected it displays an error message on iOS. I would like it to migrate to a screen, and on this screen when connected it goes back to the previous screen automatically. Is it possible to do this?

1 Like

You can use this block
image

In the device drawer to check that device running the app is connected to the internet.

You can use the same block with a timer to check every few seconds and decide what to do.

I try This but not Working See my blocks.


Capturar2

1 Like

I Change Screen 1 for False. But not Working Too.

Try changing a label’s text value (“online” or “offline”) on each screen when the device is online. And also when the device is offline. Then test it and report back. If you can’t get it to work, post a link to your project and someone here can test it on their own device.

1 Like

@Gustavo_Lima, also try using the “starts” event rather than the opens event.

1 Like

I tested it with this code and I can see it working

image

Thanks for replys i try this now! @tatiang You asked me to post the project link, if you can take a look please, thank you very much.

https://x.thunkable.com/copy/66eb161f26ae6738affb1270fe74c28d

Yes but you haven’t made the changes that @muneer and @domhnallohanlon suggested so there’s not much point in testing it yet…

1 Like

I have tested the code I shared earlier on my phone and was switching the WIFI and mobile data on and off and see that the code gives the right message in the screen.

I only shared the code after having tested in myself.

1 Like