registerOnConnectionFailed static method
Register a callback invoked when a connection attempt fails.
The provided callback receives a GemError describing the failure reason. This registration is currently available only on Android.
Parameters
callback: Function called with a GemError describing the failure reason.
Throws
- PlatformException when the platform does not support this callback (non-Android).
Implementation
static void registerOnConnectionFailed(
void Function(GemError reason) callback,
) {
if (!Platform.isAndroid) {
throw PlatformException(
code: 'PlatformNotSupported',
message: 'The platform is not Android.',
);
}
_onConnectionFailed = callback;
}