(item: CommerceItem)
| 8 | |
| 9 | export const Commerce = () => { |
| 10 | const handleClick = (item: CommerceItem) => { |
| 11 | const purchasedItem = new IterableCommerceItem( |
| 12 | item.id, |
| 13 | item.name, |
| 14 | item.price, |
| 15 | 1 |
| 16 | ); |
| 17 | const totalPrice = item.price; |
| 18 | const purchaseItems = [purchasedItem]; |
| 19 | const dataFields = null; |
| 20 | |
| 21 | Iterable.trackPurchase(totalPrice, purchaseItems, dataFields); |
| 22 | |
| 23 | console.group('Purchase tracked with the following arguments:'); |
| 24 | console.log('Total price:', totalPrice); |
| 25 | console.log('Purchase items:', [...purchaseItems]); |
| 26 | console.log('Data fields:', dataFields); |
| 27 | console.groupEnd(); |
| 28 | |
| 29 | Alert.alert( |
| 30 | `Tracked purchase: ${item.name}, $${item.price}`, |
| 31 | 'Check logs for output' |
| 32 | ); |
| 33 | }; |
| 34 | |
| 35 | return ( |
| 36 | <SafeAreaView> |
no test coverage detected
searching dependent graphs…