registerOnConnectFinished static method

void registerOnConnectFinished(
  1. void callback(
    1. GemError connection,
    2. NetworkType networkType,
    3. ProxyDetails? httpsProxyInfo,
    4. ProxyDetails? httpProxyInfo,
    )
)

Register a callback to be invoked when the connection is finished.

Only Android supports this feature.

Parameters

  • IN connection The connection information.
  • IN networkType The type of network.
  • IN httpsProxyInfo The HTTPS proxy information.
  • IN httpProxyInfo The HTTP proxy information.

Throws

Implementation

static void registerOnConnectFinished(
  void Function(
    GemError connection,
    NetworkType networkType,
    ProxyDetails? httpsProxyInfo,
    ProxyDetails? httpProxyInfo,
  )
  callback,
) {
  if (!Platform.isAndroid) {
    throw PlatformException(
      code: 'PlatformNotSupported',
      message: 'The platform is not Android.',
    );
  }
  _onConnectFinished = callback;
}