beginSession static method
- @Deprecated('This function is deprecated, please use "beginSession" of Countly.instance.sessions instead')
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'. returns the error or success message
Implementation
@Deprecated('This function is deprecated, please use "beginSession" of Countly.instance.sessions 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;
}