There are several network checking extensions available for AI2, or you can do it just with blocks
https://imagnity.com/tutorials/app-inventor/check-internet-connection-in-app-inventor/
You should really be asking this on the Kodular community, there are several topics about API31...