registerOnConnectionFailed static method

void registerOnConnectionFailed(
  1. void callback(
    1. GemError reason
    )
)

Register a callback to be invoked when the connection fails.

Only Android supports this feature.

Parameters

  • IN reason The reason for the failure.

Throws

Implementation

static void registerOnConnectionFailed(
  void Function(GemError reason) callback,
) {
  if (!Platform.isAndroid) {
    throw PlatformException(
      code: 'PlatformNotSupported',
      message: 'The platform is not Android.',
    );
  }
  _onConnectionFailed = callback;
}