---
updatedAt: 2026-04-29T10:47:24.000Z
---

# Reporting Events Using React Native SDK

Events are used to track meaningful user interactions (purchase, add to cart, form completion, rating a product, and so on) for the purpose of behavioral targeting, reporting, and recommendations. Learn more about [Events](https://dy.dev/dy-dev/docs/reporting-events).

Use the DYSdk object to report events to Dynamic Yield.

## Required events per vertical

### reportPurchaseEvent

> Mandatory event for e-commerce sections

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name: String <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value: Float<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "currency",
    "2-1": "CurrencyType? = nil",
    "3-0": "uniqueTransactionId",
    "3-1": "String? = nil",
    "4-0": "cart  <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "[CartInnerItem]",
    "5-0": "CartInnerItem.productId",
    "5-1": "String",
    "6-0": "CartInnerItem.quantity",
    "6-1": "Int",
    "7-0": "CartInnerItem.Itemprice",
    "7-1": "Float"
  },
  "cols": 2,
  "rows": 8,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
import { boolVal, CurrencyType, events, EventType, listVal, mapVal, numVal, SortOrderType, strVal, VideoProgressType, type SupportedValue } from '@DynamicYield/react-native-sdk'

async function reportPurchaseEvent() {
    await events.reportPurchaseEvent({
        name: "purchase-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        uniqueTransactionId: "unique-id",
        cart: [
            {
                productId: "product-id",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        switch (result.status) {
            case 'SUCCESS':
                //A purchase event has been reported successfully
                break;
            case 'WARNING':
                result.warnings?.forEach(warning => {
                    // Log the warnings
                });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}
```

### reportAddToCartEvent

> Mandatory event for e-commerce sections

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "currency",
    "2-1": "CurrencyType? = nil",
    "3-0": "quantity<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "Int",
    "4-0": "productId <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "String",
    "5-0": "cart",
    "5-1": "[CartInnerItem]? = nil",
    "6-0": "CartInnerItem.productId",
    "6-1": "String",
    "7-0": "CartInnerItem.quantity",
    "7-1": "Int",
    "8-0": "CartInnerItem.Itemprice",
    "8-1": "Float"
  },
  "cols": 2,
  "rows": 9,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportAddToCartEvent() {
    await events.reportAddToCartEvent({
        name: "add-to-cart-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        productId: "product-id",
        quantity: 3,
        cart: [
            {
                productId: "product-id-red-shirt",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}

```

### reportApplicationEvent

> Mandatory event for Financial Institute sections

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "currency",
    "2-1": "CurrencyType? = nil",
    "3-0": "quantity<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "Int",
    "4-0": "productId <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "String",
    "5-0": "cart",
    "5-1": "[CartInnerItem]? = nil",
    "6-0": "CartInnerItem.productId",
    "6-1": "String",
    "7-0": "CartInnerItem.quantity",
    "7-1": "Int",
    "8-0": "CartInnerItem.Itemprice",
    "8-1": "Float"
  },
  "cols": 2,
  "rows": 9,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportApplicationEvent() {
    await events.reportApplicationEvent({
        name: "application-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        productId: "application-id",
        quantity: 3,
        cart: [
            {
                productId: "application-id",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}

```

### reportSubmissionEvent

> Mandatory event for Financial Institute sections

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name: String <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value: Float<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "currency",
    "2-1": "CurrencyType? = nil",
    "3-0": "uniqueTransactionId",
    "3-1": "String? = nil",
    "4-0": "cart: <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "[CartInnerItem]",
    "5-0": "CartInnerItem.productId",
    "5-1": "String",
    "6-0": "CartInnerItem.quantity",
    "6-1": "Int",
    "7-0": "CartInnerItem.Itemprice",
    "7-1": "Float"
  },
  "cols": 2,
  "rows": 8,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportSubmissionEvent() {
    await events.reportSubmissionEvent({
        name: "submission-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        uniqueTransactionId: "unique-id",
        cart: [
            {
                productId: "product-id",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

## Events used for cross-channel identification

### reportSignUpEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "cuidType",
    "1-1": "String?",
    "2-0": "cuid",
    "2-1": "String? = nil",
    "3-0": "secondaryIdentifiers",
    "3-1": "[SecondaryIdentifier]? =nil",
    "4-0": "secondaryIdentifiers.type",
    "4-1": "String",
    "5-0": "secondaryIdentifiers.value",
    "5-1": "String"
  },
  "cols": 2,
  "rows": 6,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportSignUpEvent() {
    await events.reportSignUpEvent({
        name: "sign-in-event",
        cuidType: "email",
        cuid: "cuid",
        secondaryIdentifiers: [
            {
                type: "phoneNumber",
                value: "+972503803434"
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportLoginEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "cuidType<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "cuid<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "String? = nil",
    "3-0": "secondaryIdentifiers",
    "3-1": "[SecondaryIdentifier]? =nil",
    "4-0": "secondaryIdentifiers.type",
    "4-1": "String",
    "5-0": "secondaryIdentifiers.value",
    "5-1": "String"
  },
  "cols": 2,
  "rows": 6,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportLoginEvent() {
    await events.reportLoginEvent({
        name: "log-in-event",
        cuidType: "email",
        cuid: "cuid",
        secondaryIdentifiers: [
            {
                type: "phoneNumber",
                value: "+972503803434"
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportIdentifyUserEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "cuidType<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "cuid",
    "2-1": "String? = nil",
    "3-0": "secondaryIdentifiers",
    "3-1": "[SecondaryIdentifier]? =nil",
    "4-0": "secondaryIdentifiers.type",
    "4-1": "String",
    "5-0": "secondaryIdentifiers.value",
    "5-1": "String"
  },
  "cols": 2,
  "rows": 6,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportIdentifyUserEvent() {
    await events.reportIdentifyUserEvent({
        name: "identify-user-id-event",
        cuidType: "email",
        cuid: "cuid",
        secondaryIdentifiers: [
            {
                type: "phoneNumber",
                value: "+972503803434"
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportNewsletterEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "cuidType",
    "1-1": "String?",
    "2-0": "cuid",
    "2-1": "String? = nil",
    "3-0": "secondaryIdentifiers",
    "3-1": "[SecondaryIdentifier]? =nil",
    "4-0": "secondaryIdentifiers.type",
    "4-1": "String",
    "5-0": "secondaryIdentifiers.value",
    "5-1": "String"
  },
  "cols": 2,
  "rows": 6,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
 async function reportNewsletterEvent() {
    await events.reportNewsletterEvent({
        name: "news-letter-event",
        cuidType: "email",
        cuid: "cuid",
        secondaryIdentifiers: [
            {
                type: "phoneNumber",
                value: "+972503803434"
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

## Additional event schemas

### reportRemoveFromCartEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "quantity <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "int",
    "3-0": "productId <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "String",
    "4-0": "currency",
    "4-1": "CurrencyType? = nil",
    "5-0": "cart",
    "5-1": "[CartInnerItem]? = nil",
    "6-0": "CartInnerItem.productId",
    "6-1": "String",
    "7-0": "CartInnerItem.quantity",
    "7-1": "int",
    "8-0": "CartInnerItem.Itemprice",
    "8-1": "Float"
  },
  "cols": 2,
  "rows": 9,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportRemoveFromCartEvent() {
    await events.reportRemoveFromCartEvent({
        name: "submission-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        productId: "product-id",
        quantity: 1,
        cart: [
            {
                productId: "product-id",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportSyncCartEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "value <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float",
    "2-0": "currency <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "CurrencyType? = nil",
    "3-0": "cart",
    "3-1": "[CartInnerItem]? = nil",
    "4-0": "CartInnerItem.productId",
    "4-1": "String",
    "5-0": "CartInnerItem.quantity",
    "5-1": "int",
    "6-0": "CartInnerItem.Itemprice",
    "6-1": "Float"
  },
  "cols": 2,
  "rows": 7,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportSyncCartEvent() {
    await events.reportSyncCartEvent({
        name: "sync-cart-event",
        value: 5.3,
        currency: CurrencyType.IDR,
        cart: [
            {
                productId: "product-id",
                quantity: 2,
                itemPrice: 8
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportMessageOptInEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

**Note:** We recommend implementing this event on the server-side where the push-id is generated.

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "pushId<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String"
  },
  "cols": 2,
  "rows": 1,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportPushOptInEvent() {
    await events.reportPushOptInEvent({
        name: "report-push-opt-in-event",
        pushId: "97597d39-ed90-4cd4-8dba-99f8676d8348"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportMessageOptOutEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

**Note:** We recommend implementing this event on the server-side where the push-id is generated.

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "pushId<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "Stirng"
  },
  "cols": 2,
  "rows": 1,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportPushOptOutEvent() {
    await events.reportPushOptOutEvent({
        name: "report-push-opt-out-event",
        pushId: "97597d39-ed90-4cd4-8dba-99f8676d8348"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportInformAffinityEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "source",
    "1-1": "String? = nil",
    "2-0": "data<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "[InformAffinityData]",
    "3-0": "InformAffinityData.attributes<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "String",
    "4-0": "InformAffinityData.values<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "[String]"
  },
  "cols": 2,
  "rows": 5,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportInformAffinityEvent() {
    await events.reportInformAffinityEvent({
        name: "report-inform-affinity",
        source: "source",
        data: [
            {
                attribute: "attribute",
                values: ["value-1", "value-2"]
            }
        ]
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportAddToWishListEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "productId<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "size",
    "2-1": "String? =nil"
  },
  "cols": 2,
  "rows": 3,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportAddToWishListEvent() {
    await events.reportAddToWishListEvent({
        name: "add-to-wish-list-event",
        productId: "productId",
        size: "medium"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportVideoWatchEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "itemId<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "autoplay <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "Boolean",
    "3-0": "progress<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "[VideoProgressType](https://dy.dev/dy-dev/docs/swift-sdk-references#videoprogresstype) ",
    "4-0": "progressPercent<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "4-1": "CurrencyType? = nil",
    "5-0": "categories",
    "5-1": "[String]? =nil"
  },
  "cols": 2,
  "rows": 6,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportVideoWatchEvent() {
    await events.reportVideoWatchEvent({
        name: "report-video-watch-event",
        itemId: "itemId",
        categories: ["category-1", "category-2"],
        autoplay: true,
        progress: VideoProgressType.PREROLL_FINISHED,
        progressPercent: 3
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportKeywordSearchEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "keywords<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String"
  },
  "cols": 2,
  "rows": 2,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportKeywordSearchEvent() {
    await events.reportKeywordSearchEvent({
        name: "keyword-search-event",
        keywords: "search"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportChangeAttributesEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "attributeType<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "attributeValue<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "String"
  },
  "cols": 2,
  "rows": 3,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportChangeAttributesEvent() {
    await events.reportChangeAttributesEvent({
        name: "change-attribute-event",
        attributeType: "price",
        attributeValue: "5"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportFilterItemsEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "filterType<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "filterStringValue",
    "2-1": "String? = nil",
    "3-0": "filterNumericValue<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "3-1": "int? = nil"
  },
  "cols": 2,
  "rows": 4,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportFilterItemsEvent() {
    await events.reportFilterItemsEvent({
        name: "filter-items-event",
        filterType: "someType",
        filterStringValue: "value"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportSortItemsEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "sortBy<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "String",
    "2-0": "sortOrder<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "2-1": "[SortOrderType](https://dy.dev/dy-dev/docs/swift-sdk-references#sortordertype)  "
  },
  "cols": 2,
  "rows": 3,
  "align": [
    "left",
    "left"
  ]
}
[/block]

\**Example*

```javascript React Native
async function reportSortItemsEvent() {
    await events.reportSortItemsEvent({
        name: "sort-items-event",
        sortBy: "price",
        sortOrder: SortOrderType.ASC
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

### reportPromoCodeEnterEvent

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "code<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "Float"
  },
  "cols": 2,
  "rows": 2,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportSingleEvent() {
    await events.reportPromoCodeEnterEvent({
        name: "promoCodeEvent",
        code: "code-example"
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

## Custom Events

Use custom events to report events that are not defined in the SDK but are significant to your business.

### reportCustomEvents

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "name<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "properties<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "1-1": "CustomProperties"
  },
  "cols": 2,
  "rows": 2,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportCustomEvent() {
    await events.reportCustomEvent({
        name: "custom-event-name",
        map: new Map<string, SupportedValue>([
            ['color', strVal('red')],
            ['size', numVal(38)],
            ['list', listVal([strVal('a'), numVal(1), null])],
            ['map', mapVal({ inner: boolVal(false) })]
        ])
    }).then((result) => {
        // Check the result status
    }).catch((error) => {
        // Handle error
    });
}
```

## Reporting multiple events

### reportEvents

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure",
    "0-0": "DYEvent<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "[DYEvent]"
  },
  "cols": 2,
  "rows": 1,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportMultiEvent() {
    await events.reportEvents({
        events: [
            [
                EventType.PromoCodeEnter,
                {
                    name: 'pre-define-event',
                    code: 'code'
                }
            ],
            [
                EventType.Custom,
                {
                    name: 'dynamic-custom-event',
                    map: new Map<string, SupportedValue>([
                        ['map', mapVal({ inner: boolVal(false) })]
                    ])
                }
            ],
            [
                EventType.Custom,
                {
                    name: 'second-test-custom-event',
                    map: new Map<string, SupportedValue>([
                        ['parameterInt', numVal(1)],
                        ['parameterFloat', numVal(5.2)]
                    ])
                }
            ]
        ]
    }).then((result) => {
    }).catch((error) => {
        // Handle error
    });
}
```