setIntegrationSource static method

Future<void> setIntegrationSource(
  1. String source
)

Sets the integration source for telemetry attribution.

Call this after init() to override the default "manual" source. Used by UIKit's initFromSettings() to mark the integration as "ai-agent".

Parameters:

  • source - The integration source (e.g., "ai-agent" or "manual")

Implementation

static Future<void> setIntegrationSource(String source) async {
  try {
    final sdk = SdkRegistry.getInstance();
    await sdk.preferences?.setIntegrationSource(source);
    Logger.info('CometChat', 'Integration source set: $source');
  } catch (e) {
    Logger.error('CometChat', 'Set integration source failed', e);
  }
}