endSession static method
End session for manual session handling. This method needs to be called for ending a session only if manual session handling is enabled by calling the 'enableManualSessionHandling' method of 'CountlyConfig'.
Implementation
@Deprecated('Use Countly.instance.sessions.endSession instead')
static Future<String?> endSession() async {
if (!_instance._countlyState.isInitialized) {
String message = '"initWithConfig" must be called before "endSession"';
log('endSession, $message', logLevel: LogLevel.ERROR);
return message;
}
log('Calling "endSession", manual session control enabled:[$_manualSessionControlEnabled]');
if (!_manualSessionControlEnabled) {
String error = '"endSession" will be ignored since manual session control is not enabled';
log(error);
return error;
}
final String? result = await _channel.invokeMethod('endSession');
return result;
}