isExtensionEnabled static method
Future<bool>
isExtensionEnabled(
- String extensionId, {
- dynamic onSuccess()?,
- dynamic onError(
- CometChatException excep
Implementation
static Future<bool> isExtensionEnabled(String extensionId , {Function(bool )? onSuccess,
Function(CometChatException excep)? onError}) async {
try {
final result = await channel.invokeMethod('isExtensionEnabled', {
"extensionId": extensionId
});
if(onSuccess != null) onSuccess(result as bool);
return result as bool;
} on PlatformException catch (platformException) {
if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
return false;
} catch (e) {
debugPrint("Error: $e");
if(onError != null) onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
return false;
}