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

# flushPostbacks(responses:)

Sends the test postbacks and handles the responses.

```
func flushPostbacks(responses: @escaping @Sendable ([String : SKAdTestPostbackResponse]?, (any Error)?) -> Void)
```

```
func flushPostbacksWithResponses() async throws -> [String : SKAdTestPostbackResponse]
```

## Parameters

`responses`

A handler that matches the signature of [`SKANTestPostbackResponseHandler`](/documentation/StoreKitTest/SKANTestPostbackResponseHandler).

## Discussion

This method sends the test postbacks that you set up using [`setPostbacks(_:)`](/documentation/StoreKitTest/SKAdTestSession/setPostbacks(_:)) to the server URL provided in each postback, and then deletes them from this test session. Note that you set up the postback server URL when you create the postback instance using [`SKAdTestPostback`](/documentation/StoreKitTest/SKAdTestPostback).

This method calls the response handler with either a dictionary that contains postback [`transactionIdentifier`](/documentation/StoreKitTest/SKAdTestPostback/transactionIdentifier) keys with their responses ([`SKAdTestPostbackResponse`](/documentation/StoreKitTest/SKAdTestPostbackResponse)), or a single [`SKAdTestError`](/documentation/StoreKitTest/SKAdTestError) error. If you receive an error, it indicates a failure that isn’t specific to any single postback, but is a general issue; for example, a test session has no postbacks, there’s a connectivity issue, or the postbacks aren’t registered.

To perform tests with postbacks, do the following:

1. Create a test postback using [`SKAdTestPostback`](/documentation/StoreKitTest/SKAdTestPostback).
2. Add the test postbacks to the test session by calling [`setPostbacks(_:)`](/documentation/StoreKitTest/SKAdTestSession/setPostbacks(_:)).
3. In the code representing the advertised app, register the test postback by calling <doc://com.apple.documentation/documentation/StoreKit/SKAdNetwork/updatePostbackConversionValue(_:completionHandler:)>or <doc://com.apple.documentation/documentation/StoreKit/SKAdNetwork/registerAppForAdNetworkAttribution()>.
4. Optionally, update the conversion value by calling <doc://com.apple.documentation/documentation/StoreKit/SKAdNetwork/updatePostbackConversionValue(_:completionHandler:)>.
5. Call [`flushPostbacks(responses:)`](/documentation/StoreKitTest/SKAdTestSession/flushPostbacks(responses:)) when you’re done updating the conversion value and are ready to test receiving postbacks on your server.

---

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)