setAllowInternetConnection static method

void setAllowInternetConnection(
  1. bool allowInternetConnection
)

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:

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());
  }
}