updateAttribution method

Future<void> updateAttribution(
  1. Map attribution, {
  2. required AdaptyAttributionSource source,
  3. String? networkUserId,
})

You can set attribution data for the profile, using method. Read more on the Adapty Documentation

Parameters:

  • attribution: a map containing attribution (conversion) data.
  • source: a source of attribution.
  • networkUserId: a string profile's identifier from the attribution service.

Implementation

Future<void> updateAttribution(
  Map attribution, {
  required AdaptyAttributionSource source,
  String? networkUserId,
}) async {
  if (!AdaptySDKNative.isIOS && source == AdaptyAttributionSource.appleSearchAds) {
    AdaptyLogger.write(AdaptyLogLevel.warn, 'Apple Search Ads is supporting only on iOS');
    return null;
  }

  return await _invokeMethodHandlingErrors<void>(Method.updateAttribution, {
    Argument.attribution: attribution,
    Argument.source: source.jsonValue,
    if (networkUserId != null) Argument.networkUserId: networkUserId,
  });
}