Custom Events iOS - How to send an array of items on the properties object

Hello,

I am sending custom events to Airship, along with properties on the properties object. I am able to access properties on the properties object when I send data along with a custom event like this:

let addToCartRetailTemplate = UARetailEventTemplate.addedToCart()
let addToCartRetailEvent = addToCartRetailTemplate.createEvent()
var propertyDictionary = Dictionary <String, Any>()
propertyDictionary["brand"] = "brand_value"
addToCartRetailEvent.properties = propertyDictionary
addToCartRetailEvent.track()

But I can't access properties sent as an array of objects. How do I send/access properties on the properties object when sending an array of objects? I want to send something like this to Airship

{
    "items": [
        {
          "brand": "brand_value"
        }
    ]
}

so I can access it like the example in your documentation: 

{{#each items}}
{{brand}}
{{/each}}

Didn't find what you were looking for?

New post

Comments

4 comments

  • Hi Nathan, 

    Since you fall under Footlocker support, I've gone ahead and created a support ticket for you. Please respond there for further support. 

    Best wishes, 

    Frenchy F.
    Technical Support Engineer | Airship | New York

    Comment actions Permalink
  • In iOS development, when working with custom events, you often need to send additional data along with the event to provide context or detailed information. If you need to send an array of items within the properties object of a custom event Explore now, you can do so by serializing your array into a format that can be passed as a parameter.

    Comment actions Permalink
    0
  • I am sending custom events to Airship, along with properties on the properties object. I am able to access properties on the properties object when I send data along with a custom event like this: promotional keyrings

    Comment actions Permalink
    0
  • When sending custom events in iOS, it's possible to include an array of items within the properties object. This can be useful for tracking events that involve multiple related data points, such as a list of products in a cart for llaollao price. To do this, you should structure the properties dictionary to include an array as one of its values. 

    Comment actions Permalink
    0

Please sign in to leave a comment.