<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKAdTestPostback",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAdTestPostback"
  },
  "title" : "SKAdTestPostback"
}
-->

# SKAdTestPostback

A test postback that contains ad conversion information in the testing environment.

```
class SKAdTestPostback
```

## Overview

Use this class to create test postbacks to use for unit testing.

In the production environment, the system creates a postback after a user installs an advertised app. The advertised app is responsible for registering the installation and may update the conversion value. The system sends the postback after a timer expires.

In the testing environment, you can mimic a postback by creating it directly. You control the property values within the postback. Use it to test your app’s ability to register the app installation and update conversion values, and to test your server’s ability to receive postbacks.

## Topics

### Creating test postbacks

[`init?(version: SKAdTestPostbackVersion, adNetworkIdentifier: String, sourceIdentifier: String, appStoreItemIdentifier: Int, sourceAppStoreItemIdentifier: Int, sourceDomain: String?, fidelityType: Int, isRedownload: Bool, didWin: Bool, postbackURL: String)`](/documentation/StoreKitTest/SKAdTestPostback/init(version:adNetworkIdentifier:sourceIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:sourceDomain:fidelityType:isRedownload:didWin:postbackURL:))

Creates a test postback for a web ad or an in-app ad.

[`class func winningPostbacks(withVersion: SKAdTestPostbackVersion, adNetworkIdentifier: String, sourceIdentifier: String, appStoreItemIdentifier: Int, sourceAppStoreItemIdentifier: Int, sourceDomain: String?, fidelityType: Int, isRedownload: Bool, postbackURL: String) -> [SKAdTestPostback]?`](/documentation/StoreKitTest/SKAdTestPostback/winningPostbacks(withVersion:adNetworkIdentifier:sourceIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:sourceDomain:fidelityType:isRedownload:postbackURL:))

Creates a sequence of test postbacks for an in-app or web ad impression.

[`init?(version: SKAdTestPostbackVersion, adNetworkIdentifier: String, adCampaignIdentifier: Int, appStoreItemIdentifier: Int, sourceAppStoreItemIdentifier: Int, conversionValue: Int, fidelityType: Int, isRedownload: Bool, didWin: Bool, postbackURL: String)`](/documentation/StoreKitTest/SKAdTestPostback/init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:))

Creates a test postback for an in-app ad.

### Getting the Postback Destination

[`var postbackURL: String`](/documentation/StoreKitTest/SKAdTestPostback/postbackURL)

A URL on your server where the testing environment sends test postbacks.

### Getting general information

[`var version: SKAdTestPostbackVersion`](/documentation/StoreKitTest/SKAdTestPostback/version)

The SKAdNetwork version that the postback uses.

[`var transactionIdentifier: String`](/documentation/StoreKitTest/SKAdTestPostback/transactionIdentifier)

A unique transaction identifier that the system generates.

[`var postbackSequenceIndex: Int`](/documentation/StoreKitTest/SKAdTestPostback/postbackSequenceIndex)

The position of this postback among all postbacks for an ad impression.

[`var isRegistered: Bool`](/documentation/StoreKitTest/SKAdTestPostback/isRegistered)

A Boolean value that indicates whether the postback is registered in the testing environment.

[`var isRedownload: Bool`](/documentation/StoreKitTest/SKAdTestPostback/isRedownload)

A Boolean value that indicates whether the user redownloaded and reinstalled the app.

### Getting advertisement information

[`var adNetworkIdentifier: String`](/documentation/StoreKitTest/SKAdTestPostback/adNetworkIdentifier)

A string that represents the advertising network’s unique identifier.

[`var appStoreItemIdentifier: Int`](/documentation/StoreKitTest/SKAdTestPostback/appStoreItemIdentifier)

The item identifier of the app that this ad impression advertises.

[`var sourceAppStoreItemIdentifier: Int`](/documentation/StoreKitTest/SKAdTestPostback/sourceAppStoreItemIdentifier)

The item identifier of the app that displays the ad.

[`var sourceDomain: String?`](/documentation/StoreKitTest/SKAdTestPostback/sourceDomain)

The source of a web ad.

[`var sourceIdentifier: String?`](/documentation/StoreKitTest/SKAdTestPostback/sourceIdentifier)

A string that identifies an ad campaign.

### Getting conversion information

[`var fidelityType: Int`](/documentation/StoreKitTest/SKAdTestPostback/fidelityType)

An integer that indicates the type of ad impression, StoreKit-rendered or view-through.

[`var fineConversionValue: Int`](/documentation/StoreKitTest/SKAdTestPostback/fineConversionValue)

The specific conversion value of an ad postback.

[`var coarseConversionValue: SKAdNetwork.CoarseConversionValue?`](/documentation/StoreKitTest/SKAdTestPostback/coarseConversionValue)

A value that indicates a high, medium, or low conversion value for an ad postback.

[`var didWin: Bool`](/documentation/StoreKitTest/SKAdTestPostback/didWin)

A Boolean value that indicates whether the postback won the attribution.

### Getting information in earlier versions

[`var adCampaignIdentifier: Int`](/documentation/StoreKitTest/SKAdTestPostback/adCampaignIdentifier)

A number that represents the advertising network’s campaign.

[`var conversionValue: Int`](/documentation/StoreKitTest/SKAdTestPostback/conversionValue)

An unsigned 6-bit value that the app or ad network controls.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)