Skip to content

Advertising module

  • Enum: AffiseModules.ADVERTISING (lib/module/affise_modules.dart:5)
  • Native key: "Advertising" (lib/module/affise_modules.dart:33)
  • Dart accessor: Affise.module.advertising → AffiseModuleAdvertisingApi (lib/affise.dart:224, lib/module/attribution/affise_attribution_module.dart:18, 33)
  • Implementation: lib/module/advertising/affise_advertising.dart:8
  • API: lib/module/advertising/affise_module_advertising_api.dart:3

README 378-409 — collects Google Advertising ID (GAID) and other vendor-specific advertising identifiers (Amazon Fire OS, ColorOS, Alternative Store, etc.) after the user grants tracking permission.

abstract class AffiseAdvertising implements AffiseModuleAdvertisingApi {
void startModule();
Future<bool> hasModule();
}

lib/module/advertising/affise_advertising.dart.

Affise.module.advertising.startModule();

Cross-platform.

Terminal window
flutter pub add affise_attribution_lib
flutter pub add affise_attribution_module_advertising

or add the dependency to pubspec.yaml:

dependencies:
affise_attribution_lib: ^1.7.16
affise_attribution_module_advertising: ^1.7.16

The package does not expose a Dart API of its own — it only pulls in the native module dependency:

  • Android: com.affise:module-advertising:1.7.16
  • iOS (CocoaPods): AffiseModule/Advertising 1.7.16
  • iOS (Swift Package Manager): AffiseModuleAdvertising 1.7.16

Module APIs (Affise.module.*, AffiseModules) remain in affise_attribution_lib.

NSUserTrackingUsageDescription is required regardless of the install route — the app will crash without it when this module is active (README 494-503). See Configuration.

Instead of the Flutter package you can add the native dependency to the platform project yourself (README #### Native):

  • Android: implementation "com.affise:module-advertising:$affise_version"
  • iOS: pod 'AffiseModule/Advertising', affise_version
  • GAID_ADID (lib/parameters/provider_type.dart:95)
  • GAID_ADID_MD5 (:96)
  • OAID (:97)
  • OAID_MD5 (:98)
  • ADID (:99)
  • ALTSTR_ADID (:100)
  • FIREOS_ADID (:101)
  • COLOROS_ADID (:102)
  • AD_PERSONALIZATION (:103)
  • ADVERTISER_TRACKING_ENABLED (:104) — new in 1.7.9
  • APPLICATION_TRACKING_ENABLED (:105) — new in 1.7.9