[Swift] Analytics - Product variable implementation is not in documentation

kevinj52562561

20-08-2019

Hello everyone!

I have a quick question about swift syntax to implement products info in analytics.

In this document: Product variable - Adobe Experience Platform Mobile SDKs

We only have info about Obective-C implementation.

Can anyone help me on the syntax for Swift? Can the documentation be uptated?

Thanks!

View Entire Topic

Jen_Andrews

Employee

20-08-2019

kevinj52562561

The sample code above is when using Product variable with Merchandising Variable.

The link Arjun provided above shows documentation for a Product variable only.

arjunbhadra

I get a compile error with

var contextData: [AnyHashable : Any] = [:]

Cannot convert value of type '[AnyHashable : Any]' to expected argument type '[String : String]?'

I change to

  var contextData: [String : String] = [:]

Compiled successfully and received the correct information in the hit sent to Analytics.

Can you confirm that is the correct method?

Thanks,
Jen