Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Test for Internet Connection

Featured Replies

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.

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 by Kris M

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...

Does anyone have a suggestion for the best way to test for an Internet connection on FileMaker Go?

Get(NetworkType)

 

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....

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...

  • 4 years later...

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

How long is the timeout using Insert from URL? Isn’t it the typical 60 secs?

@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.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.