setPostbacks(_:)
Add test postbacks to the test session.
Declaration
func setPostbacks(_ postbacks: [SKAdTestPostback]) throwsParameters
- postbacks:
An array of one to six test postbacks you add to a test session. The first postback must always be the winning postback with a
didWinvalue oftrue. There must be only one winning postback.
Discussion
An error occurs if any of the test postbacks are invalid or if there’s an issue with the set of test postbacks. Otherwise, the test passes.
Create postbacks using the initializer for SKAdTestPostback, init(version:adNetworkIdentifier:adCampaignIdentifier:appStoreItemIdentifier:sourceAppStoreItemIdentifier:conversionValue:fidelityType:isRedownload:didWin:postbackURL:). Add the postbacks to the test session by calling setPostbacks(_:).
Calling setPostbacks(_:) overwrites previous postbacks in the test session, if any exist.
Include up to six test postbacks in your test session if you want to mimic the behavior of postbacks when users experience multiple ad impressions for the same app. For more information about attributions when there are multiple ad impressions, see Receiving ad attributions and postbacks.
The array of test postbacks in the test session need to follow the same rules that SKAdNetwork uses for postbacks, including:
The
postbacksarray can only contain up to six postbacks.The first postback in the array must be the only winning postback in the array, with a
didWinvalue oftrue.All postbacks, except the first postback in the array, have a
didWinvalue offalse.