os_is_network_connected

Checks to see if the device has an internet connection or not.

Syntax:

os_is_network_connected()


Returns: Boolean


Description

With this function you can check and see if your device currently has an internet connection and it will return true if it does, or false if it does not.

NOTE: This function checks the internal device API that controls connections and so may return true if there is a bluetooth connection, a Wi-Fi connection, or even just a normal network connection that permits internet access.


Example:

if os_is_network_connected()
   {
   facebook_init();
   }

The above code checks to see if the device has a connection to the internet and if so initialises the GameMaker Studio 2 Facebook API.