adzerk / adzerk-ios-sdk

Access Adzerk's ad serving APIs via iOS
https://www.adzerk.com
Other
9 stars 5 forks source link

Missing additionalOptions on placements #35

Closed karnowski closed 3 years ago

karnowski commented 3 years ago

Background

In version 2.0 we added support for additionalOptions at the placement level to support new parameters on the Kevel servers without having to change/update the iOS SDK. They are meant to be added to the request JSON payload at the placement level.

However, there was some misunderstandings around this feature and the "custom properties" JSON data structure for targeting. As such, we don't currently support additionalOptions at the placement level.

Example

For example, code similar to this:

let placement2 = Placements.custom(divName: "div0", adTypes: [5])
placement2.additionalOptions = [
    "skipSelection": .boolean(true),
]

Should generate a JSON payload like this:

{
  "placements" : [
    {
      "siteId" : 667480,
      "adTypes" : [5],
      "networkId" : 23,
      "divName" : "div0",
      "skipSelection": true
    }
  ],
}

Acceptance Criteria

Out of Scope

Note that there is a similar mechanism on the top-level of the request, and it is also not working correctly. However, we are tracking that as a separate issue, so it is out of scope.

karnowski commented 3 years ago

Note that I clarified the acceptance criteria. additionalOptions and properties (i.e. "custom properties) are not related.

karnowski commented 3 years ago

Related documentation: https://dev.kevel.co/reference/placement-body-parameters