Closed c-lamont closed 3 years ago
Found the solution.
For other people, here is the value for the items parameter. If there is a better solution then please let me know.
private static NSArray GetProductItemsArray (IEnumerable<ProductItemEventDto> productItemEvents)
{
var mutableArray = new NSMutableArray();
foreach (var productItemEvent in productItemEvents)
{
var keys = new []
{
new NSString(ParameterNamesConstants.ItemId),
new NSString(ParameterNamesConstants.ItemName),
new NSString(ParameterNamesConstants.ItemCategory),
new NSString(ParameterNamesConstants.Price),
new NSString(ParameterNamesConstants.Currency),
new NSString(ParameterNamesConstants.Discount)
};
var values = new NSObject[]
{
new NSString(productItemEvent.ProductCode),
new NSString(productItemEvent.ProductName),
new NSString(string.Empty),
new NSDecimalNumber(productItemEvent.Price),
new NSString(productItemEvent.Currency),
new NSDecimalNumber(productItemEvent.Discount)
};
var dict = new NSDictionary<NSString, NSObject>(keys, values);
mutableArray.Add(dict);
}
return mutableArray;
}
@bhuwancb99 I'm not sure what you are asking for.
I would like to add the
ParameterNamesConstants.Items
parameter when I log an event.According to Firebase the documentation this is possible: https://firebase.google.com/docs/analytics/measure-ecommerce#objective-c
My current solution says that the
Items
parameter is too long.My
Items
parameter is Key: NSString "Items" Value: NSArrayAdding Items works well for Android, but I have tried a lot of things to make this work with iOS and I can not get it to work. Is it possible to do this on iOS? What type does the
Items
value need to be?