setAllowInternetConnection static method
Enables or disables SDK access to the internet.
When enabled, the SDK may perform offboard operations such as checking for content updates. Disabling internet access prevents those operations from starting.
Parameters
allowInternetConnection: set true to allow SDK network access, false to block it.
Also see:
- SdkSettings.allowConnection - Query the current internet access setting.
- SdkSettings.offBoardListener - Receiving events about content updates.
- NetworkProvider - Managing network connectivity and status.
Implementation
static void setAllowInternetConnection(bool allowInternetConnection) {
GemKitPlatform.instance.registerEventHandler(
offBoardListener.id,
offBoardListener,
);
staticMethod(
'SdkSettings',
'setAllowConnection',
args: <String, dynamic>{
'allow': allowInternetConnection,
'listener': offBoardListener.id,
},
);
_offBoardListener = offBoardListener;
if (allowInternetConnection) {
unawaited(NetworkProvider.refreshNetwork());
}
}