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