Contents

endImpression(_:completionHandler:)

Indicates that your app is no longer presenting a view-through ad to the user.

Declaration

class func endImpression(_ impression: SKAdImpression, completionHandler completion: (@Sendable ((any Error)?) -> Void)? = nil)
class func endImpression(_ impression: SKAdImpression) async throws

Parameters

  • impression:

    An instance of Skadimpression with the properties set for the view-through ad that you presented. This must be the same instance you provide in Startimpression(_:completionhandler:).

  • completion:

    The callback handler you provide to handle any tasks relevant to concluding the ad impression.

Mentioned in

Discussion

Call this method when you end the presentation of a view-through ad and it’s no longer visible to the user. To help ensure it’s a valid impression, StoreKit only records the impression if the ad displays for a minimum amount of time. That minimum is 2 seconds on devices running iOS 15.4 and iPadOS 15.4 and later, and 3 seconds on devices running earlier versions of iOS and iPadOS. If the app displays the ad for fewer than the minimum number of seconds, StoreKit doesn’t record the ad impression for attribution.

StoreKit records a maximum of 15 view-through ad impressions per source app for various products before discarding the oldest-recorded impression.

For more information about ad impressions and attributions, see Receiving ad attributions and postbacks.

See Also

Signing view-through ads