Skip to content

AndroidId module

Android counterpart of the iOS Persistent module: keeps the Affise random device ID stable across app reinstalls. for background.

  • AffiseModules.ANDROIDID = "AndroidId" (src/module/AffiseModules.ts:1-16)
  • Android only. No JS surface beyond the module gate.

Since 1.7.16 the module ships as its own npm package, affise-attribution-module-androidid (Android). Install it next to the core library:

Terminal window
npm install affise-attribution-lib
npm install affise-attribution-module-androidid

The package only pulls in the native dependency (com.affise:module-androidid at 1.7.16); its JS entry point is empty, so keep importing everything from affise-attribution-lib. Rebuild the Android app after installing.

Instead of the npm package you can add the native dependency yourself (README “Modules → Manual Native”):

Add the Maven coordinate to your app-level build.gradle:

implementation "com.affise:module-androidid:$affise_version"

From src/parameters/ProviderType.ts:2-90, the core attribution group already declares:

  • ANDROID_ID
  • ANDROID_ID_MD5
  • AFFISE_DEVICE_ID
  • AFFISE_ALT_DEVICE_ID