---
title: SDK Methods
slug: sdks/methods
description: Definitions and code examples of the methods used in the React Web, React Native, iOS, and Android versions of the Monetate SDK
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-06-11T17:39:03.701Z
---

The following methods are available to use in the Monetate SDK. All methods are part of the personalization class.

For parameters that require event names, refer to [SDK Event and Action Types](docId\:JrD_OD6JWuAGwlErZuXUc) for syntax.

## generateMonetateId

:::Paragraph{indent="1"}
This method generates a Monetate ID and returns it as a string. You can store this ID locally for future use.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
generateMonetateId Method

```javascript
static generateMonetateId(): string
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
generateMonetateId Method

```javascript
static generateMonetateId(): string
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
generateMonetateId Method

```swift
public func generateMonetateID () -> String
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs
generateMonetateId Method

```java
public static string generateMonetateId();
```
:::
::::
:::::

### Code Example

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
generateMonetateId Method Example

```javascript
const monetateId = Personalization.generateMonetateId()
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
generateMonetateId Method Example

```javascript
const monetateId = Personalization.generateMonetateId()
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
generateMonetateId Method Example

```swift
let monetateId = self.personalization.generateMonetateID()
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="1"}
generateMonetateId Method Example

```java
String monetateId = Personalization.generateMonetateId();
```
:::
::::
:::::

***

## report (legacy)

:::BlockQuote{indent="1"}
**Note:** This is the legacy **report()** method supported for backward compatibility.For Context Layer–based reporting, see [report\[New\]](https://developer.monetate.com/sdks/methods#59AlM).
:::

:::Paragraph{indent="1"}
Reports an event to Monetate. This allows data to later be used for decisions within Monetate. Use this method to report events.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
report Method

```javascript
report(context: EventTypes, events: ContextData): void
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
report Method

```javascript
report(context: EventTypes, events: ContextData): void
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
report Method

```json
report(context: <ContextEnum>, event: <MEvent?>)
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
report Method

```javascript
public void report(String context, Object events){}
```
:::

:::Paragraph{indent="2"}
This method must be run in a thread.
:::
::::
:::::

The parameters are as follows:

| **Parameter** | **Required** | **Description**       |
| ------------- | ------------ | --------------------- |
| `context`     | Yes          | The name of the event |
| `events`      | Yes          | The event data        |

### Code Example

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
report Method Example

```javascript
const personalizationInstance = new Personalization(user, account);

const cart = {
  "cartLines": [{
    "sku": "SKU1",
    "pid": "PID1",
    "quantity": 2,
    "currency": "USD",
    "value": "24.00"
  }] 
};
personalizationInstance.report(
  EventTypes.ContextCart, 
  { cartLines: cart }
);
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
report Method Example

```javascript
const personalizationInstance = new Personalization(user, account);

const cart = {
  "cartLines": [{
    "sku": "SKU1",
    "pid": "PID1",
    "quantity": 2,
    "currency": "USD",
    "value": "24.00"
  }] 
};
personalizationInstance.report(
  EventTypes.ContextCart, 
  { cartLines: cart }
);
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
report Method Example

```swift
objPersonalization.report(context: .RecClicks, event: RecClicks(recClicks: ["rt.1.xxx", "rt.1.yyy"]))  
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="1"}
report Method Example

```javascript
Account account = new Account("localhost.org", "a-701b337c", "p", "localhost");
User user = new User();
user.setDeviceId("1109349827122");

try
{
  Personalization personalization = new Personalization(user, account);
  IpAddress address = new IpAddress();
  address.setIpAddress("127.0.0.0.");
  new Thread(new Runnable()
  {
    @Override
    public void run()
    {
      personalization.report(EventTypes.ContextIpaddress, address);
    }
  }).start();
}
catch (AccountDetailsException e)
{
  e.printStackTrace();
}
```
:::
::::
:::::

***

## report \[New]

:::BlockQuote{indent="1"}
**Note:**&#x54;hese enhancements are currently available for the **Android** and **iOS** SDKs.The **React SDK** is not impacted by these changes.
:::

:::Paragraph{indent="1"}
**Availability**
:::

:::Paragraph{listStyleType="disc" indent="2"}
<font color="#2166ae">**Android**</font>**:** 1.0.6-A or later&#x20;
:::

:::Paragraph{listStyleType="disc" listStart="2" indent="2"}
<font color="#2166ae">**iOS**</font>**:** 2026.01.06 or later

Refer to the [Reporting Methods](https://developer.monetate.com/sdks/report-methods) section for details.
:::

***

## addEvent

:::Paragraph{indent="1"}
This method adds event data to the SDK's internal stack. Use this method to add events to the stack that you intend to use to trigger experiences. You can use multiple calls of this method to add multiple events to stack. Use this method with [getActionsData](docId\:F5SIeJXaS3hi38DaXdVPy) when an experience requires data from more than one event.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
addEvent Method

```javascript
addEvent(context: EventTypes, events: ContextData): void
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
addEvent Method

```javascript
addEvent(context: EventTypes, events: ContextData): void
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
addEvent Method

```swift
addEvent(context: <ContextEnum>, event: <MEvent?>)
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="1"}
addEvent Method

```javascript
public void addEvent(String context, Object event)
```
:::
::::
:::::

:::Paragraph{indent="1"}
The parameters are as follows:
:::

| **Parameter** | **Required** | **Description**       |
| ------------- | ------------ | --------------------- |
| `context`     | Yes          | The name of the event |
| `events`      | Yes          | The event data        |

:::Heading{depth="3" indent="1"}
Code Example
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
addEvent Method Example

```javascript
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
  ipAddress: "10.0.0.2",
});

personalizationInstance.addEvent(EventTypes.ContextPageView, {
  url: "http://www.monetate.com/index.html",
  pageType: "Home"
});
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
addEvent Method Example

```javascript
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
  ipAddress: "10.0.0.2",
});

personalizationInstance.addEvent(EventTypes.ContextPageView, {
  url: "http://www.monetate.com/index.html",
  pageType: "Home"
});
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
addEvent Method Example

```swift
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))

objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))

objPersonalization.addEvent(context: .PageView, event: PageView(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: []))
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="1"}
addEvent Method Example

```javascript
IpAddress ipAddress = new IpAddress();
ipAddress.setIpAddress("1.0.0.0");

ScreenSize screenSize = new ScreenSize();
screenSize.setHeight(1011);
screenSize.setWidth(2011);

PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");

personalization.addEvent(EventTypes.ContextIpAddress, ipAddress);
personalization.addEvent(EventTypes.ContextPageView, pageView);
personalization.addEvent(EventTypes.ContextScreenSize, screenSize);
```
:::
::::
:::::

***

## getActionsData

:::Paragraph{indent="2"}
Requests an experience decision from Monetate based off the action type. You can specify multiple action types in an array to get multiple responses.
:::

:::Paragraph{indent="2"}
The experience decision depends on event data reported using [addEvent](docId\:F5SIeJXaS3hi38DaXdVPy) calls. Use `addEvent` to add report all of the relevant events before you use this method to request a decision.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
getActionsData Method

```javascript
getActionsData(actionType: Array<string>, includeReporting?: boolean) : Promise<any>
```
:::

The parameters are as follows:

| **Parameter**      | **Description**                                                                                               |
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
| `actionType`       | The type of action you want to request. You can specify one action or multiple actions in an array to handle. |
| `includeReporting` | Indicates whether the response will have impression reporting data.                                           |
::::

::::Tab{title="React Web"}
:::CodeblockTabs
getActionsData Method

```javascript
getActionsData(actionType: Array<string>, includeReporting?: boolean) : Promise<any>
```
:::

The parameters are as follows:

- `actionType` is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
- `includeReporting` indicates whether the response will have impression reporting data.
::::

::::Tab{title="iOS"}
:::CodeblockTabs
getActionsData Method

```swift
getActionsData(requestId: <String>, includeReporting: <Bool>, arrActionTypes: <[String]>) 
```
:::

The parameters are as follows:

- `requestID` is the request ID for the API.
- `includeReporting` indicates whether the response will have impression reporting data.
- `arrActionTypes` is the type of actions you want to request. You can specify multiple actions in an array to handle.
::::

::::Tab{title="Android"}
:::CodeblockTabs
getActionsData Method

```javascript
public String getActionsData(String[] actionTypes, boolean includeReports)
```
:::

The parameters are as follows:

:::Paragraph{listStyleType="disc" indent="2"}
`actionTypes` is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
:::

:::Paragraph{listStyleType="disc" listStart="2" indent="2"}
`includeReports` indicates whether the response will have impression reporting data.
:::
::::
:::::

:::Heading{depth="3" indent="1"}
Code Examples
:::

:::Paragraph{indent="2"}
The following example specifies a single action.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
getActionsData Method Example

```javascript
personalizationInstance
  .getActionsData("monetate:action:OmnichannelJson")
  .then(res => {
    recsData = res[0].actions;
  })
  .catch(error => {
    console.warn('Error!', error);
  });
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
getActionsData Method Example

```javascript
personalizationInstance
  .getActionsData("monetate:action:OmnichannelJson")
  .then(res => {
    recsData = res[0].actions;
  })
  .catch(error => {
    console.warn('Error!', error);
  });
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
getActionsData Method Example

```swift
objPersonalization.getActionsData(
  requestId: "123456", includeReporting: false,
  arrActionTypes: ["monetate:action:OmniChannelRecommendation"]
).on { res in
  if res.status == 200 {
    self.handleRecommendations(res: res)
  } else {
  }
}
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
getActionsData Method Example

```javascript
try
{
  Personalization personalization = new personalization(user, account);
  
  // Events and context data
  IpAddress ipAddress = new IpAddress();
  ipAddress.setIpAddress("1.0.0.0");
  ScreenSize screenSize = new ScreenSize();
  screenSize.setHeight(1011);
  screenSize.setWidth(2011);
  PageView pageView = new PageView();
  pageView.setPageType("Cartpage");
  pageView.setUrl("https://www.monetate.com");
  
  // addEvent
  personalization.addEvent(EventTypes.ContextScreenSize, screenSize);
  personalization.addEvent(EventTypes.ContextIpAddress, ipAddress);
  personalization.addEvent(EventTypes.ContextPageView, pageView);
  
  // getActionsData
  String responseData;
  new Thread(new Runnable()
  {
    @Override
    public void run()
    {
      // Gets the responseData using getActionsData
      responseData = personalization.getActionsData("monetate:action:OmnichannelJson", true);
      // Once you receive the responseData from getActionsData, use the Handler and parse the required data from it 
      new Handler(Looper.getMainLooper()).post(new Runnable()
      {
        @Override
        public void run()
        {
          // Parse the received responseData, get the requiredData from it and use it accordingly
          try
          {
            // Example: textView.setText(requiredData);
          }
          catch (Exception ex)
          {
            // Catch any exception that occurs while parsing 
            ex.printStackTrace();
          }
        }
      });
    }
  }).start();
}
catch (AccountDetailsException e)
{
  e.printStackTrace();
}
```
:::
::::
:::::

:::Paragraph{indent="2"}
The following example specifies multiple actions.
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
getActionsData Method Example with Multiple Actions

```javascript
// For multiple actions, send an array
// When an empty array in passed as an argument, it will fetch all the configured Omnichannel actions
const requiredActions : [ "monetate:action:OmnichannelRecommendation" 
  , "monetate:action:SocialProofDataV2" ]
personalizationInstance
  .getActionsData(requiredActions)
  .then(res => {
    recsData = res[0].actions;
  })
  .catch(error => {
    console.warn('Error!', error);
  });
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
getActionsData Method Example with Multiple Actions

```javascript
// For multiple actions, send an array
// When an empty array in passed as an argument, it will fetch all the configured Omnichannel actions
const requiredActions : [ "monetate:action:OmnichannelRecommendation" 
  , "monetate:action:SocialProofDataV2" ]
personalizationInstance
  .getActionsData(requiredActions)
  .then(res => {
    recsData = res[0].actions;
  })
  .catch(error => {
    console.warn('Error!', error);
  });
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
getActionsData Method Example with Multiple Actions

```swift
objPersonalization.getActionsData(
  requestId: "123456", includeReporting: false,
  arrActionTypes: ["monetate:action:OmniChannelJson", "monetate:action:OmniChannelRecommendation"]
).on { res in
  if res.status == 200 {
    self.handleRecommendations(res: res)
  } else {
  }
}
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
getActionsData Method Example with Multiple Actions

```java
try
{
  Personalization personalization = new personalization(user, account);
  
  // Events and context data
  IpAddress ipAddress = new IpAddress();
  ipAddress.setIpAddress("1.0.0.0");
  ScreenSize screenSize = new ScreenSize();
  screenSize.setHeight(1011);
  screenSize.setWidth(2011);
  PageView pageView = new PageView();
  pageView.setPageType("Cartpage");
  pageView.setUrl("https://www.monetate.com");
  
  // addEvent
  personalization.addEvent(EventTypes.ContextScreenSize, screenSize);
  personalization.addEvent(EventTypes.ContextIpAddress, ipAddress);
  personalization.addEvent(EventTypes.ContextPageView, pageView);
  
  // getActionsData
  String responseData;
  new Thread(new Runnable()
  {
    @Override
    public void run()
    {
      // Gets the responseData using getActionsData
      responseData = personalization.getActionsData(new String[]{"monetate:action:OmnichannelJson","monetate:action:OmnichannelRecommendation"}, true);
      // Once you receive the responseData from getActionsData, use the Handler and parse the required data from it 
      new Handler(Looper.getMainLooper()).post(new Runnable()
      {
        @Override
        public void run()
        {
          // Parse the received responseData, get the requiredData from it and use it accordingly
          try
          {
            // Example: textView.setText(requiredData);
          }
          catch (Exception ex)
          {
            // Catch any exception that occurs while parsing 
            ex.printStackTrace();
          }
        }
      });
    }
  }).start();
}
catch (AccountDetailsException e)
{
  e.printStackTrace();
}
```
:::
::::
:::::

***

# getActions ( legacy )&#x20;

:::BlockQuote{indent="1"}
**Note:** This is the legacy **getActions()** flow supported for backward compatibility.For the Context Layer–based approach, see [getActions()\[New\]](https://developer.monetate.com/sdks/methods#DJr_q)
:::


Reports an event and immediately requests a decision from Monetate. Use this method if an experience you want to trigger requires a single event. This method returns a JSON object that includes the response data.

The response data can then be used in your application. For example, you can use this method to obtain data to display as a banner on a page.

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
getActions Method

```javascript
getActions(actionType, context?, eventData?, includeReporting?) : Promise<any>
```
:::

The parameters are as follows:

| **Parameter**      | **Description**                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------------- |
| `actionType`       | The type of action you want to request. You can specify multiple actions in an array to handle. |
| `context`          | The name of the event.                                                                          |
| `eventData`        | The data associated with the event.                                                             |
| `includeReporting` | Indicates whether the response will have impression reporting data                              |
::::

::::Tab{title="React Web"}
:::CodeblockTabs
getActions Method

```javascript
getActions(actionType, context?, eventData?, includeReporting?) : Promise<any>
```
:::

Parameters:

- `actionType` is the type of action you want to request. You can specify multiple actions in an array to handle.
- `context` is name of the event.
- `eventData` is the data associated with the event.
- `includeReporting` indicates whether the response will have impression reporting data.
::::

::::Tab{title="iOS"}
:::CodeblockTabs
getActions Method

```swift
objPersonalization.getActions(context: <ContextEnum>, requestId: <String>, includeReporting: <Bool>, arrActionTypes: <[String]>, event: <MEvent?>)
```
:::

Parameters:

- `context` is name of the event.
- `requestID` is the request ID for the API.
- `includeReporting` indicates whether the response will have impression reporting data.
- `arrActionTypes` is the type of actions you want to request. You can specify multiple actions in an array to handle.
- `event` is the data associated with the event.
::::

::::Tab{title="Android"}
:::CodeblockTabs
getActions Method

```javascript
public String getActions(String context, Object event, String[] actionTypes, boolean includeReports) {returns response;}
```
:::

:::Paragraph{indent="1"}
The parameters are as follows:
:::

:::Paragraph{listStyleType="disc" indent="2"}
`actionTypes` is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
:::

:::Paragraph{listStyleType="disc" listStart="2" indent="2"}
`context` is name of the event.
:::

:::Paragraph{listStyleType="disc" listStart="3" indent="2"}
`event` is the data associated with the event.
:::

:::Paragraph{listStyleType="disc" listStart="4" indent="2"}
`includeReports` indicates whether the response will have impression reporting data.
:::
::::
:::::

:::Heading{depth="3" indent="1"}
Code Example
:::

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
getActions Method Example

```javascript
import React, { useEffect, useState} from "react" ;
import { View , Text} from "react-native" ;
import Personalization from '@personalization-js-sdk/react-native';
import { ActionTypes, EventTypes } from "@personalization-js-sdk/common";

const test = () => {
  const personalizationInstance = new Personalization(account, user)
  const [actionData, setActionData] = useState({});

  const handleGetActions = () => {
    const eventType = EventTypes.ContextCart;
    personalizationInstance.getActions("monetate:action:OmnichannelJson", eventType)
      .then((res) => {
        if (res.length > 0) {
          res[0].actions.map((action) => {
            if (action.json.meta && action.json.meta.tool === 'react-native') {
              const data = {
                color: action.json.data.json.color,
                text: action.json.data.json.text,
                fontSize: action.json.data.json.fontSize,
                style: action.json.data.json.style,
                buttonText: action.json.data.json.buttonText,
                buttonColor: action.json.data.json.buttonColor,
              };
              setActionData(prevState => {
                return {
                  ...prevState,
                  decisionEventData: data,
                }
              });
            } else {
              console.warn('Meta Object not present in Omni JSON.');
            }
          });
        }
      })
      .catch((error) => console.warn('Please try after some time!', error));
  };

  useEffect(() => {
    handleGetActions();
  }, []);

  return <View>
        <Text> {actionData.buttonText} //Render Data On UI 
    </View>;
};
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
getActions Method Example

```javascript
import React, { useEffect, useState} from "react" ;
import Personalization from '@personalization-js-sdk/web';
import { ActionTypes, EventTypes } from "@personalization-js-sdk/common";

const test = () => {
  const personalizationInstance = new Personalization(account, user)
  const [actionData, setActionData] = useState({});

  const handleGetActions = () => {
    const eventType = EventTypes.ContextCart;
    personalizationInstance.getActions("monetate:action:OmnichannelJson", eventType)
      .then((res) => {
        if (res.length > 0) {
          res[0].actions.map((action) => {
            if (action.json.meta && action.json.meta.tool === 'web') {
              const data = {
                color: action.json.data.json.color,
                text: action.json.data.json.text,
                fontSize: action.json.data.json.fontSize,
                style: action.json.data.json.style,
                buttonText: action.json.data.json.buttonText,
                buttonColor: action.json.data.json.buttonColor,
              };
              setActionData(prevState => {
                return {
                  ...prevState,
                  decisionEventData: data,
                }
              });
            } else {
              console.warn('Meta Object not present in Omni JSON.');
            }
          });
        }
      })
      .catch((error) => console.warn('Please try after some time!', error));
  };

  useEffect(() => {
    handleGetActions();
  }, []);

  return <div> 
       <p> {actionData.buttonText} //Render Data On UI </p>
    </div>;
};
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
getActions Method Example

```swift
import MarqueeLabel
import UIKit
import monetate_ios_sdk

class CategoryViewController: UIViewController {

  @IBOutlet weak var bottomLabel: MarqueeLabel!
  @IBOutlet weak var bottomView: UIView!
  @IBOutlet weak var constraintHeightBottomView: NSLayoutConstraint!
  final var objPersonalization = Personalization(
    account: Account(
      instance: "p", domain: "localhost.org", name: "a-701b337c", shortname: "localhost"),
    user: User(deviceId: "62bd2e2d-213d-463f-83bb-12c0b2530a14"))

  override func viewDidLoad() {
    super.viewDidLoad()
    self.bottomView.isHidden = true
    self.constraintHeightBottomView.constant = 0
    bottomLabel.text = ""
  }

  override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    pageEvent()
  }

  func pageEvent() {
    objPersonalization.getActions(
      context: .PageView, requestId: "test_request_id", includeReporting: false,
      arrActionTypes: ["monetate:action:OmniChannelJson"],
      event: PageView(
        pageType: "Homepage", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
    ).on { (res) in
      if res.status == 200 {
        let data = JSON(res.data)
        print(data)
        self.handleAction(res: res)
      } else {
      }
    }
  }

  fileprivate func handleAction(res: APIResponse) {
    let data = JSON(res.data)
    for item in data["data"]["responses"].arrayValue {
      bottomLabel.animationCurve = .linear
      bottomLabel.speed = .duration(5)
      bottomLabel.fadeLength = 15.0

      if item["requestId"].string == res.requestId {
        for oneaction in item["actions"].arrayValue {
          let component = oneaction["component"].string ?? ""
          if component.lowercased() == "footer" {
            if let json = oneaction["json"].dictionary {
              print("final dict \(json)")
              if let text = json["text"]?.string {
                self.bottomView.isHidden = false
                self.constraintHeightBottomView.constant = 60
                bottomLabel.text = text
                if let fontStyle = json["style"]?.string, let fontSize = json["fontSize"]?.double {
                  if fontStyle == "bold" {
                    bottomLabel.font = UIFont(name: "Roboto-Bold", size: fontSize)
                  } else if fontStyle == "normal" {
                    bottomLabel.font = UIFont(name: "Roboto-Regular", size: fontSize)
                  } else if fontStyle == "italic" {
                    bottomLabel.font = UIFont(name: "Roboto-Italic", size: fontSize)
                  }
                }
                if let color = json["color"]?.string {
                  bottomLabel.textColor = MiscClass.hexStringToUIColor(hex: color)
                }
                if let backgroundColor = json["background-color"]?.string {
                  bottomView.backgroundColor = MiscClass.hexStringToUIColor(hex: backgroundColor)
                  return
                }
              }
            }
          }
        }
      }
    }
  }
}
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
getActions Method Example

```javascript
Account account = new Account("localhost.org", "a-701b337c", "p", "localhost");
User user = new User();
user.setDeviceId("1109349827122");

try
{
  Personalization personalization = new Personalization(user, account);
  IpAddress address = new IpAddress();
  address.setIpAddress("127.0.0.0.");
  String responseData;
  
  new Thread(new Runnable()
  {
    @Override
    public void run()
    {
      // Get the responseData using getActions
      responseData = personalization.getActions(EventTypes.ContextIpAddress, address, new String[] {"monetate:action:OmnichannelJson"}, true);
      // Once you receive the responseData from getActions, use the Handler and parse the required data from it
      new Handler(Looper.getMainLooper()).post(new Runnable()
      {
        @Override
        public void run()
        {
          // Parse the received responseData, get the requiredData from it and use it accordingly
          try
          {
            // Example: textView.setText(requiredData);
          }
          catch (Exception ex)
          {
            // Catch any exception that occurs while parsing 
            ex.printStackTrace();
          }
        }
      });
    }
  }).start();
}
catch (AccountDetailsException e)
{
  e.printStackTrace();
}
```
:::
::::
:::::

***

# getActions()  \[New]

:::BlockQuote
**Note:** These enhancements are currently available for the **Android** and **iOS** SDKs. The **React SDK** is not impacted by these changes.
:::

**Availability**

- **Android:** 1.0.6-A or later&#x20;
- **iOS** : 2026.01.01 or later

Refer to [getActions](https://developer.monetate.com/sdks/getactions) method section for details.

***

## flush

Immediately sends all event data that are currently queued. Use this method if you want to report an event immediately. This method returns a response of success or failure.

This method might throw the following exceptions that you must handle:

1. `InterruptedException`
2. `ExecutionException`
3. `TimeoutException`

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
flush Method

```javascript
flush()
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
flush Method

```javascript
flush()
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
flush Method

```swift
flush()
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
flush Method

```javascript
public String flush() throws InterruptedException, ExecutionException, TimeoutException {}
```
:::
::::
:::::

### Code Example

:::::Tabs
::::Tab{title="React Web"}
:::CodeblockTabs
flush Method Example

```javascript
const Personalization= new Personalization(account, user);

PersonalizationInstance.report (
  'monetate:context:IpAddress',
  { ipAddress: 10.10.10.10 }
),
Personalization.flush();
```
:::

You can also capture the method response in a variable:

:::CodeblockTabs
flush Method Reponse Example

```javascript
const response = Personalization.flush()
```
:::
::::

::::Tab{title="React Native"}
:::CodeblockTabs
flush Method Example

```javascript
const Personalization= new Personalization(account, user);

PersonalizationInstance.report (
  'monetate:context:IpAddress',
  { ipAddress: 10.10.10.10 }
),
Personalization.flush();
```
:::

You can also capture the method response in a variable:

:::CodeblockTabs
flush Method Response Example

```javascript
const response = Personalization.flush()
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
flush Method Example

```swift
objPersonalization.report(context: .RecClicks, event: RecClicks(recClicks: ["rt.1.xxx", "rt.1.yyy"]))
objPersonalization.report(context: .RecImpressions, event: RecImpressions(recImpressions: ["rt.2.xxx", "rt.2.yyy"]))
objPersonalization.flush()
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
flush Method Example

```javascript
try
{
  Personalization personalization = new Personalization(user, account);
  IpAddress address = new IpAddress();
  address.setIpAddress("127.0.0.0.");
  new Thread(new Runnable()
  {
    @Override
    public void run()
    {
      Personalization.report(EventTypes.ContextIpaddress, address);
      personalization.flush();
    }
  }).start();
}
catch (Exception e)
{
  e.printStackTrace();
}
```
:::
::::
:::::

***

## setCustomerId

Updates the `customerId` within the [User object](docId\:DYLOPO9oTr0SIAOBjo_TG).

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
setCustomerId Method

```javascript
setCustomerId(customerId)
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
setCustomerId Method

```javascript
setCustomerId(customerId)
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
setCustomerId Method

```swift
setCustomerId(customerId)
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs{indent="2"}
setCustomerId Method

```javascript
public void setCustomerId(String customerId);
```
:::
::::
:::::

The parameter is as follows:

1. `customerId` is a string containing the customer ID. (Required)

### Code Example

:::::Tabs
::::Tab{title="React Native"}
:::CodeblockTabs
setCustomerId Method Example

```javascript
personalizationInstance.setCustomerId("test_customer_id");
```
:::
::::

::::Tab{title="React Web"}
:::CodeblockTabs
setCustomerId Method Example

```javascript
personalizationInstance.setCustomerId("test_customer_id");
```
:::
::::

::::Tab{title="iOS"}
:::CodeblockTabs
setCustomerId Method Example

```swift
objPersonalization.setCustomerId(customerId:"155468")
```
:::
::::

::::Tab{title="Android"}
:::CodeblockTabs
setCustomerId Method Example

```javascript
personalization.setCustomerId("test_customer_id");
```
:::
::::
:::::

