network.canDetectNetworkStatusChanges

Type Boolean
Library network.*
Revision Current Public Release (2017.3135)
Keywords network status, reachability, canDetectNetworkStatusChanges
See also network.setStatusListener()
networkStatus

Overview

Returns true if network reachability events are supported on the current platform.

Syntax

network.canDetectNetworkStatusChanges

Gotchas

Network reachability (networkStatus) events are only supported on macOS and iOS.

Example

local function networkListener( event )
    print( "Network event" )
end

if ( network.canDetectNetworkStatusChanges ) then
    network.setStatusListener( "www.coronalabs.com", networkListener )
else
    print( "Network reachability not supported on this platform." )
end