Перейти к содержимому

Hardware module

Это содержимое пока не доступно на вашем языке.

Populate device and hardware providers: user agent, CPU, screen metrics, OS version, locale, carrier codes and similar.

  • AffiseModules.HARDWARE = "Hardware" (src/module/AffiseModules.ts:16)
  • Android and iOS — backed by the native com.affise:module-hardware artifact and the AffiseModule/Hardware subspec.
  • No dedicated JS accessor on Affise.module. Use the constant for module gating (setDisableModules), status (Affise.module.getStatus) and presence checks (Affise.module.getModulesInstalled()).

The module ships as its own npm package, affise-attribution-module-hardware (Android and iOS). Install it next to the core library:

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

The package only pulls in the native dependency (com.affise:module-hardware / AffiseModule/Hardware at 1.7.18); its JS entry point is empty, so keep importing everything from affise-attribution-lib. Rebuild the native app (and run pod install on iOS) after installing.

Instead of the npm package you can add the native dependencies yourself (README “Modules → Manual Native”). The README recommends the npm package.

pod 'AffiseModule/Hardware', '1.7.18'
implementation "com.affise:module-hardware:$affise_version"

From the README “Hardware” provider list:

  • USER_AGENT
  • CPU_TYPE
  • CPU_CORES
  • DEVICE_NAME
  • PROXY_IP_ADDRESS
  • SCREEN_WIDTH
  • SCREEN_HEIGHT
  • DENSITY
  • HARDWARE_NAME
  • DEVICE_TYPE
  • OS_VERSION
  • MCCODE
  • MNCODE
  • ISP
  • NETWORK_TYPE
  • CONNECTION_TYPE
  • TIMEZONE_DEV
  • LANGUAGE
  • COUNTRY
  • REGION
  • DEVICE_MANUFACTURER
  • OS_NAME

All of these constants already exist in ProviderType (src/parameters/ProviderType.ts); the enum was not changed in 1.7.18.