registerOnConnectionFailed static method
Register a callback to be invoked when the connection fails.
Only Android supports this feature.
Parameters
- IN reason The reason for the failure.
Throws
- PlatformException if the platform is not 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;
}