How to trigger a "No Internet" Warning Pop-up?

Is there a way for Hype to detect if the internet is turned off on Android and iOS? I'm embedding some iframes but I'm concerned that if the user is using the app that the iframes won't load because they have their phones on "airplane mode" or if they simply don't have internet in their vicinity.
I basically just want a pop-up to say something like- "This app requires an internet connection to function properly."
Any help would be much appreciated.

Thanks,

M

I haven’t made an example yet but using Hype Action Events allows you to register elements to these events by just assigning data-window-online-action and data-window-offline-action with an function or action. Either way the property mentioned by @h_classen should do the trick.

Apologies, I am a total rookie at this. lol Perhaps a step-by-step breakdown of how I can implement this???

I tested it with Hype Action Events this morning and saw some things that could be improved soon. So, nothing before Monday from me as I am on the road. That would be a version subscribing to the event change. For active probing you could go ahead with the suggestion with/from @h_classen

Also read for a DIY solution

Ha, I had to go far into the Photics.com archives for this one…

The problem…

I like this part… "Hopefully soon, I’ll look back at this post and laugh." …because I did laugh. :smile:

The answer…

At least, that was the answer in 2009. I haven't had this problem in such a long time, as I keep everything local. I'm not sure if the “onError” popup will work, as I think WKWebKit blocks popups, so maybe that JavaScript could just trigger an animation in Hype.

But if I had to check for Internet today, in an iOS/macOS/iPadOS app, I'd probably use something on the app side rather than the web side.

CleanShot 2022-02-13 at 20.24.20@2x
CleanShot 2022-02-13 at 20.25.02@2x

Here you go with an example using Hype Data Events.

Example_Data_Attribute_Window_Online_Offline.hype.zip (18,8 KB)

2 Likes

Thanks so much! Very helpful!