SKAdTestSession flushPostbacks cannot find postbacks

I am testing postbacks by using StoreKitTest and followed the sample code for creating test postback, updating postback conversion value and sending/receiving postbacks as shown here in Apple's StoreKit test documentation.

Executing test for sending postback fails as flushPostbacks(responses:) returns "Error Domain=ASDErrorDomain Code=1270 "No test postbacks found".

I checked that

  • the test postback exists
  • our postback server is up and running and that it is accepting connections
  • project is configured
    • project's Info.plist has our ad network identifier
    • source app identifier is 0 (as it is in testing environment)

Can someone please tell me why test postbacks cannot be found in flushPostbacks(responses:) and also point me to the ASDErrorDomain documentation (There doesn't seem any documentations)?

Accepted Reply

I realized the cause of the problem was that, flushPostbacks(responses:) got executed before updateConversionValue(_:completionHandler:). In order to fix this problem, I made sure that the tests are executed in the correct order.

Replies

I forgot to mention that I'm using Xcode 14.1 & Swift 5 and my test deployment OS is iOS 15.4 and 16.1

I realized the cause of the problem was that, flushPostbacks(responses:) got executed before updateConversionValue(_:completionHandler:). In order to fix this problem, I made sure that the tests are executed in the correct order.