<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKAdTestError",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "s:SC17SKAdTestErrorCodeLeV"
  },
  "title" : "SKAdTestError"
}
-->

# SKAdTestError

An error the testing environment returns for SKAdNetwork testing errors.

```
struct SKAdTestError
```

## Overview

Unit tests that call [`setPostbacks(_:)`](/documentation/StoreKitTest/SKAdTestSession/setPostbacks(_:)), [`flushPostbacks(responses:)`](/documentation/StoreKitTest/SKAdTestSession/flushPostbacks(responses:)), [`validateImpression(parameters:publicKey:)`](/documentation/StoreKitTest/SKAdTestSession/validateImpression(parameters:publicKey:)), and [`validate(_:publicKey:)`](/documentation/StoreKitTest/SKAdTestSession/validate(_:publicKey:)), can throw [`SKAdTestError`](/documentation/StoreKitTest/SKAdTestError) errors.

When you call the unit test methods [`validateImpression(parameters:publicKey:)`](/documentation/StoreKitTest/SKAdTestSession/validateImpression(parameters:publicKey:)), [`validate(_:publicKey:)`](/documentation/StoreKitTest/SKAdTestSession/validate(_:publicKey:)), or [`validateWebAdImpressionPayload(_:publicKey:)`](/documentation/StoreKitTest/SKAdTestSession/validateWebAdImpressionPayload(_:publicKey:)) to validate your ad impression, the system may return signature-related errors.

When you call [`setPostbacks(_:)`](/documentation/StoreKitTest/SKAdTestSession/setPostbacks(_:)) and [`flushPostbacks(responses:)`](/documentation/StoreKitTest/SKAdTestSession/flushPostbacks(responses:)), you may get postback-related errors.

## Topics

### Getting the Error Domain

### Getting Error Properties

### Getting Signature Errors

[`static var missingSignature: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/missingSignature)

The signature for the ad is missing, in the testing environment.

[`static var signatureInvalidKey: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureInvalidKey)

The public key isn’t a valid cryptographic key, in the testing environment.

[`static var signatureInvalidOrder: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureInvalidOrder)

The order of the parameters in the signature is invalid, in the testing environment.

[`static var signatureMissingAdNetworkId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingAdNetworkId)

The signature is missing an ad network identifier, in the testing environment.

[`static var signatureMissingAppAdamId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingAppAdamId)

The signature is missing the app item identifier for the advertised app, in the testing environment.

[`static var signatureMissingFidelityType: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingFidelityType)

The signature is missing the fidelity type, in the testing environment.

[`static var signatureMissingNonce: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingNonce)

The signature is missing the nonce, in the testing environment.

[`static var signatureMissingSourceAppAdamId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingSourceAppAdamId)

The signature is missing the source app item identifier, in the testing environment.

[`static var signatureMissingSourceDomain: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingSourceDomain)

The signature is missing the source domain, in the testing environment.

[`static var signatureMissingSourceIdentifier: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingSourceIdentifier)

The signature is missing the source identifier, in the testing environment.

[`static var signatureMissingTimestamp: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingTimestamp)

The signature is missing a timestamp, in the testing environment.

[`static var signatureUnknownError: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureUnknownError)

An unknown error occurred with the signature in the testing environment.

[`static var signatureVerificationFailed: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureVerificationFailed)

The signature verification failed in the testing environment.

### Getting Postback Errors

[`static var excessivePostbacks: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/excessivePostbacks)

Too many postbacks submitted to the test session.

[`static var invalidConversionValue: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidConversionValue)

The conversion value isn’t valid, in the testing environment.

[`static var invalidPostbackURL: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidPostbackURL)

The URL for the postback isn’t valid, in the testing environment.

[`static var invalidRunnerUpPostback: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidRunnerUpPostback)

A non-winning postback is defined with a version prior to version 3, in the testing environment.

[`static var invalidWinningPostbackCount: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidWinningPostbackCount)

The number of winning postbacks isn’t valid, in the testing environment.

[`static var malformedPostbacks: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/malformedPostbacks)

The postback in the testing environment is malformed.

[`static var missingPostbacks: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/missingPostbacks)

The testing environment doesn’t have any postbacks.

[`static var misplacedWinnerPostback: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/misplacedWinnerPostback)

A winning postback wasn’t found in the first position, in the testing environment.

[`static var missingWinningPostback: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/missingWinningPostback)

The testing environment is missing a winning postback.

[`static var noPendingPostbacks: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/noPendingPostbacks)

The test session doesn’t have any pending postbacks to send.

[`static var unlinkedWinningPostbacks: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/unlinkedWinningPostbacks)

The postbacks aren’t correctly related to one another.

### Getting Other Errors

[`static var invalidVersion: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidVersion)

A postback contains an incorrect version number.

[`static var invalidImpressionId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidImpressionId)

The impression ID isn’t a valid UUID string.

[`static var invalidSourceAppAdamId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidSourceAppAdamId)

The app ID is less than zero.

[`static var invalidSourceDomain: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidSourceDomain)

The source domain isn’t in the correct format.

[`static var invalidSourceIdentifier: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidSourceIdentifier)

The postback’s identifier isn’t two, three, or four digits.

[`static var unknownError: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/unknownError)

An unknown error occurred in the testing environment.

### Getting Older Errors

These errors can occur in version 3 and earlier.

[`static var invalidCampaignId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/invalidCampaignId)

The campaign ID isn’t an integer between one and one hundred.

[`static var signatureMissingCampaignId: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/signatureMissingCampaignId)

The signature is missing the campaign identifier, in the testing environment.

[`static var conflictingSource: SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/conflictingSource)

This error code is unused.

### Comparing and Hashing Errors

### Initializing the Error Objects

[`enum Code`](/documentation/StoreKitTest/SKAdTestError/Code)

Enumerated error codes related to ad network testing in the testing environment.

### Type Properties

[`static var errorDomain: String`](/documentation/StoreKitTest/SKAdTestError/errorDomain)

The domain of the error.

## Relationships

### Conforms To

[`Error`](/documentation/Swift/Error)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomNSError`](/documentation/Foundation/CustomNSError)

---

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)