recordAttributionID static method

  1. @Deprecated('Use recordIndirectAttribution instead')
Future<String?> recordAttributionID(
  1. String attributionID
)

set attribution Id for campaign attribution reporting. If this is call for iOS then 'attributionID' is IDFA If this is call for Android then 'attributionID' is ADID

Implementation

@Deprecated('Use recordIndirectAttribution instead')
static Future<String?> recordAttributionID(String attributionID) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "recordAttributionID"';
    log('recordAttributionID, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  log('Calling recordAttributionID: [$attributionID]');
  log('recordAttributionID is deprecated, use recordIndirectAttribution instead');
  if (attributionID.isEmpty) {
    String error = 'recordAttributionID, attributionID cannot be empty';
    log(error);
    return 'Error : $error';
  }
  Map<String, String> attributionValues = {};
  if (Platform.isIOS) {
    attributionValues[AttributionKey.IDFA] = attributionID;
  } else {
    attributionValues[AttributionKey.AdvertisingID] = attributionID;
  }
  final String? result = await recordIndirectAttribution(attributionValues);
  return result;
}