init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:)
Creates a test postback for an in-app ad.
Declaration
init?(version: SKAdTestPostbackVersion, adNetworkIdentifier: String, adCampaignIdentifier: Int, appStoreItemIdentifier: Int, sourceAppStoreItemIdentifier: Int, conversionValue: Int, fidelityType: Int, isRedownload: Bool, didWin: Bool, postbackURL: String)Parameters
- version:
Skadtestpostbackversion, the SKAdNetwork version. For more information about versions, see 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.plistof 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
0in the testing environment. - conversionValue:
SKAdNetwork version 2.0 and later. An unsigned 6-bit value that the installed app provides by calling 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
0indicates a view-through ad presentation; a value of1indicates 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
trueif the ad network won the attribution, andfalseif 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(_:) to add the test postbacks to the test session.
See Also
Creating test postbacks
init(version:adNetworkIdentifier:sourceIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:sourceDomain:fidelityType:isRedownload:didWin:postbackURL:)winningPostbacks(withVersion:adNetworkIdentifier:sourceIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:sourceDomain:fidelityType:isRedownload:postbackURL:)