react-native-branch-deep-linking-attribution
react-native-branch-deep-linking-attribution copied to clipboard
Commerce event is not working
I use expo (SDK v39) to our project and use expo-branch
. I tried to send events, but some events related to BranchUniversalObject
are not working. Here is my code:
const convertCartItemToBranchUniversalOptions = (item: ICartItem): BranchUniversalObjectOptions => {
return {
title: item.product.name,
contentDescription: item.product.description,
contentImageUrl: item.product.imageUrl,
contentMetadata: {
price: item.product.price,
productName: item.product.name,
productCategory: item.product.category,
currency: 'VND',
quantity: item.quantity,
},
}
}
const purchase = (BranchEvent: any, createBranchUniversalObject: any) => async (
orderId: string,
cart: ICart,
) => {
const cartItemsBranchUniversalOptions = cart.items.map(convertCartItemToBranchUniversalOptions)
const universalObjects = await Promise.all(
cartItemsBranchUniversalOptions.map((options, index) => {
return createBranchUniversalObject(cart.items[index].product.id, options)
}),
)
return new BranchEvent(BranchEvent.Purchase, universalObjects, {
transactionID: orderId,
description: 'Order successfully',
currency: 'VND',
revenue: cart.total,
}).logEvent()
}
export default purchase
Please help me take a look at it. I have send a ticket support to Branch.io. But I don't receive any response
Any luck on this issue ?