Chuck Posted July 12, 2015 Posted July 12, 2015 Does anyone have a suggestion for the best way to test for an Internet connection on FileMaker Go? I'm building a system that will run mostly with a local Go file, but will occasionally connect to a served file for updating data. Simply trying to connect takes forever to fail when there's no Internet connection. Even using `Insert from URL` as suggested by a web page I found during my Googling takes quite a while. I'm looking for a quick way to find out if there's an Internet connection or not, quick in that it doesn't make the user wait too long for the result. Thanks.
Kris M Posted July 13, 2015 Posted July 13, 2015 (edited) insert from url into a text field and then check for length of text field > 0 or err 1631. http://www.filemakertoday.com/filemakergo/4037-filemakergo/filemaker-go-tip-checking-for-an-internet-connection FYI Iphone will try to use WIFI first then use cellular. If the wifi sucks but it present it will use the sucky connection. Takes forever to fail? this method is instantaneous for me on go. Perhaps you are trying to check a server file? http://www.soliantconsulting.com/blog/2012/10/testing-whether-database-available-filemaker-server Edited July 13, 2015 by Kris M
Sky Willmott Posted July 13, 2015 Posted July 13, 2015 Yep, I agree with Kris... Using Insert from URL into a text field works very well... I typically use a very lightweight page to insert, e.g. an html page with nothing but the text "OK" on it... Then use Insert from URL and check that the text field contains the "OK" text, and also check for error code 1631...
Wim Decorte Posted July 13, 2015 Posted July 13, 2015 Does anyone have a suggestion for the best way to test for an Internet connection on FileMaker Go? Get(NetworkType)
Sky Willmott Posted July 13, 2015 Posted July 13, 2015 Get(NetworkType) only returns the connection type to the file you currently have opened, in which case, when you use it on a local FileMaker Go file, it returns '0', with no indication of whether or not you will be able to connect successfully to a hosted file. If you are already connected to a hosted database and use it then it will return '2' for cellular and '3' for WiFi connection... However, in order to test that the device even has an internet connection before attempting to connect to a hosted file (in order to avoid the lengthy delay whilst Filemaker Go attempts to connect to the hosted file if no internet connection is available), then using Insert from URL seems to work well, providing of course that the URL you are connecting to is online and available.... 1
Wim Decorte Posted July 13, 2015 Posted July 13, 2015 Fair enough.. but a valid internet connection does not mean a valid FMP connection so I think I would probably still want to check against the FM host first. If you have a valid internet connection with the "insert from url" that does not mean that the FMP connection will actually work and if it does not you'll have to wait for it to resolve anyway... 1
joaocoutinho Posted February 7, 2020 Posted February 7, 2020 I just try this approach and it worked with really low quantity of data from the web to check it. Insert from URL [ Select ; With dialog: Off ; Target: $check ; "http://google.com/checkinternet" ] If [ Get(LastError) = 1631 ] Set Variable [ $status ; Value: "Disconnected" ] Else Set Variable [ $status ; Value: "Connected" ] End If Show Custom Dialog [ $Status ] Why http://google.com/checkinternet? Because it will return a webpage with really low quantity of code. Best regards, Joao Coutinho
Josh Ormond Posted February 7, 2020 Posted February 7, 2020 How long is the timeout using Insert from URL? Isn’t it the typical 60 secs?
joaocoutinho Posted February 10, 2020 Posted February 10, 2020 @Josh Ormond Maybe. Do you have other fast solution to check the internet connection? On 2/7/2020 at 1:31 PM, Josh Ormond said: How long is the timeout using Insert from URL? Isn’t it the typical 60 secs? Just checked and its instant. No 60 seconds waiting.
Recommended Posts
This topic is 1815 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now