updateSession static method

  1. @Deprecated('Use Countly.instance.sessions.updateSession instead')
Future<String?> updateSession()

Update session for manual session handling. This method needs to be called for updating a session only if manual session handling is enabled by calling the 'enableManualSessionHandling' method of 'CountlyConfig'.

Implementation

@Deprecated('Use Countly.instance.sessions.updateSession instead')
static Future<String?> updateSession() async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "updateSession"';
    log('updateSession, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  log('Calling "updateSession", manual session control enabled:[$_manualSessionControlEnabled]');

  if (!_manualSessionControlEnabled) {
    String error = '"updateSession" will be ignored since manual session control is not enabled';
    log(error);
    return error;
  }
  final String? result = await _channel.invokeMethod('updateSession');

  return result;
}