Hello! Is there a way to check for an active internet connection? I want to do the check when the app launches.
I created a scene in storyboard and used the code I found here:
http://developer.coronalabs.com/code/check-internet-connection
scene1.lua
local http = require("socket.http") local ltn12 = require("ltn12") if http.request( "http://www.google.com" ) == nil then local function onCloseApp( event ) if "clicked" == event.action then os.exit() end end native.showAlert( "Alert", "An internet connection is required to use this application.", { "Exit" }, onCloseApp ) else storyboard.gotoScene( "scene2", "crossFade", 75 ) end
It works pretty well but slows the application. There is a huge delay between scenes and Revmob fullscreen ad no longer shows.
Is there a better way to check for an active internet connection?
Thank you!