Skip to content

SKAdNetwork

SKAdNetwork helpers are exposed on the iOS-gated Affise.ios namespace (src/module/attribution/AffiseIos.ts:7). On non-iOS platforms the methods are no-ops.

Affise.ios.registerAppForAdNetworkAttribution(completionHandler: ErrorCallback)
// src/module/attribution/AffiseIos.ts:18-21
// interface: src/module/attribution/AffiseIosApi.ts:8

ErrorCallback = (error: string) => void (src/callback/ErrorCallback.ts:1). Maps to AffiseApiMethod.SKAD_REGISTER_ERROR_CALLBACK = "skad_register_error_callback" (src/native/AffiseApiMethod.ts:34).

Affise.ios.updatePostbackConversionValue(
fineValue: bigint,
coarseValue: CoarseValue,
completionHandler: ErrorCallback,
)
// src/module/attribution/AffiseIos.ts:26-29
// interface: src/module/attribution/AffiseIosApi.ts:13

Maps to AffiseApiMethod.SKAD_POSTBACK_ERROR_CALLBACK = "skad_postback_error_callback" (src/native/AffiseApiMethod.ts:35).

CoarseValue (src/skad/CoarseValue.ts:1-13) is a thin string wrapper. Obtain instances through the SKAdNetwork helper (src/skad/SKAdNetwork.ts:3-23):

  • SKAdNetwork.CoarseConversionValue returns a new SKAdNetwork instance.
  • Instance getters high, low, medium return a CoarseValue.
  • raw(value: string): CoarseValue wraps an arbitrary string.
const coarse = SKAdNetwork.CoarseConversionValue.high; // CoarseValue

From, add the following to your Info.plist so SKAdNetwork postbacks are routed to Affise:

<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://affise-skadnetwork.com/</string>