<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKAdTestPostback/init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAdTestPostback(im)initWithVersion:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:"
  },
  "title" : "init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:)"
}
-->

# init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:)

Creates a test postback for an in-app ad.

```
init?(version: SKAdTestPostbackVersion, adNetworkIdentifier: String, adCampaignIdentifier: Int, appStoreItemIdentifier: Int, sourceAppStoreItemIdentifier: Int, conversionValue: Int, fidelityType: Int, isRedownload: Bool, didWin: Bool, postbackURL: String)
```

## Parameters

`version`

[`SKAdTestPostbackVersion`](/documentation/StoreKitTest/SKAdTestPostbackVersion), the SKAdNetwork version. For more information about versions, see <doc://com.apple.documentation/documentation/StoreKit/skadnetwork-release-notes>.

`adNetworkIdentifier`

Your ad network identifier. For the test environment, you may use any lowercased value. You must use the same value to verify the signature after you receive the postback on your server. Also, use the same ad network identifier in the `Info.plist` of the source app in the testing environment.

`adCampaignIdentifier`

The campaign identifier associated with the ad.

`appStoreItemIdentifier`

The App Store item identifier of the advertised app.

`sourceAppStoreItemIdentifier`

The App Store item identifier of the app that displays the ad. This value is `0` in the testing environment.

`conversionValue`

SKAdNetwork version 2.0 and later. An unsigned 6-bit value that the installed app provides by calling <doc://com.apple.documentation/documentation/StoreKit/SKAdNetwork/updateConversionValue(_:)>. Note: In the production environment, the conversion-value only appears in the postback if the installed app provides it, and if providing the parameter meets Apple’s privacy threshold.

`fidelityType`

SKAdNetwork version 2.2 and later. A value of `0` indicates a view-through ad presentation; a value of `1` indicates a StoreKit-rendered ad.

`isRedownload`

SKAdNetwork version 2.0 and later. A Boolean flag that in the production environment indicates that the customer redownloaded and reinstalled the app when the value is `true`.

`didWin`

SKAdNetwork version 3.0 and later. A Boolean value that’s `true` if the ad network won the attribution, and `false` if the postback represents a qualifying ad impression that didn’t win the attribution.

`postbackURL`

A URL on your server where you can receive test postbacks.

## Discussion

Create one to six test postbacks to use for unit testing. Call [`setPostbacks(_:)`](/documentation/StoreKitTest/SKAdTestSession/setPostbacks(_:)) to add the test postbacks to the test session.

---

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)