AdTargeting

@objc(YMAAdTargeting)
@objcMembers
public final class AdTargeting : NSObject, Sendable

A class with data for targeting.

  • age

    User age.

    Declaration

    Swift

    public let age: NSNumber?
  • The gender of the user. For a list of values, see the Gender section.

    Declaration

    Swift

    public let gender: Gender?
  • User location.

    Declaration

    Swift

    public let location: CLLocation?
  • The search query that the user entered in the app.

    Declaration

    Swift

    public let contextQuery: String?
  • List of tags. Matches the context in which the ad will be displayed.

    Declaration

    Swift

    public let contextTags: [String]?
  • Creates targeting data.

    Declaration

    Swift

    public init(
        age: NSNumber? = nil,
        gender: Gender? = nil,
        location: CLLocation? = nil,
        contextQuery: String? = nil,
        contextTags: [String]? = nil
    )

    Parameters

    age

    User age. Default is nil.

    gender

    The gender of the user. Default is nil.

    location

    User location. Default is nil.

    contextQuery

    The search query that the user entered in the app. Default is nil.

    contextTags

    List of tags. Matches the context in which the ad will be displayed. Default is nil.