react-native-branch-deep-linking-attribution icon indicating copy to clipboard operation
react-native-branch-deep-linking-attribution copied to clipboard

Commerce event is not working

Open tamdao opened this issue 4 years ago • 1 comments

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

tamdao avatar Nov 12 '20 06:11 tamdao

Any luck on this issue ?

dooamindshine avatar Dec 13 '21 14:12 dooamindshine