Data Cloud is rapidly becoming the backbone for next-generation mobile applications, combining real-time customer insights, sub-second personalization, and seamless service integration. Customers can use Data Cloud as a backend to deliver personalized experiences, intuitive Agentforce interactions based on a customer interaction in the app, and streamlined customer feedback management utilizing unstructured context.

In this post, we will cover the following capabilities:

We’ll highlight these objectives and explain how the dots are connected with regards to configuration and customization to make the whole project work in its entirety. We’ll demonstrate this through the lens of Acme Corp (a fictitious company) who built an iOS Swift mobile app leveraging Data Cloud and Agentforce to deliver a personalized, intelligent, and responsive mobile experience for their digital storefront.

Screenshot of Acme Store mobile app homepage displaying trending products with Add to Cart buttons, a search bar for products, and navigation tabs for Home, Account, Agentforce, and Reviews.

Salesforce Personalization for real-time mobile engagement

Note: Einstein Personalization has been renamed to Salesforce Personalization.

Today’s mobile users expect seamless, personalized, and immediate experiences. Salesforce Personalization is at the heart of our user engagement strategy.

Every user interaction within the Acme mobile app generates behavioral signals which are sent directly to Data Cloud. These signals are then enriched by leveraging Calculated Insights and Data Graphs to identify meaningful patterns and predict user preferences. This enriched data powers Salesforce Personalization, using content points to boost user interaction by converting them into meaningful user journeys, ultimately delivering relevant content. Finally, user engagement clicks can be visualized in real time within Salesforce’s Lightning web components (LWC) UX by querying the data graphs.

For instance, a customer named Lauren Bailey frequently views clothing items, but she often doesn’t complete purchases and instead saves them for a special occasion. Data Cloud captures these behavioral signals and enriches this data by leveraging calculated insights, identifying content that Lauren typically engages with and then promoting discounts and showing similar dresses. Using Salesforce Personalization, the app dynamically boosts content points highlighting similar apparel, increasing the likelihood of a conversion. This targeted content transforms her casual browsing into a meaningful, engaging customer journey, significantly improving her overall app experience.

This continuous loop of insights and personalization allows us to create deeply engaging, context-aware user experiences, significantly enhancing app engagement rates and enabling Acme to deliver hyper-personalized user experiences.

Key implementation steps

In order to integrate Salesforce Personalization in your mobile app, there are three basic components needed: 1) iOS SDKs; 2) an SDK connection to Data Cloud to insert events; and 3) Profile API’s and Personalization API’s to visualize real-time data in a data graph or retrieve personalization decision outcomes.

  • Package dependencies in an iOS Swift app are external libraries or modules integrated into the project to provide specific functionality without having to build it from scratch. In this app, CDP, SFMCSDK, and MIAW are required packages. The primary functionality of the SDK’s are mentioned below.
    • CDP: Enables marketers to elevate their engagement strategies, ensuring a purposeful and impactful connection with their target audience.
    • SFMCSDK: Facilitates the creation of targeted delivery of personalized mobile app messages to foster meaningful interactions with app users.
    • MIAW: Engages customers across the customer lifecycle, from awareness through loyalty. It provides Agentforce and enterprise teams (marketing, sales, service, and commerce) with unified and actionable data that they can quickly access and easily take action on.
    • Once the packages are added, initialize the module as documented.
    • At this point, a pipe has been built between the mobile app and Data Cloud.
  • The next step is to set up the mobile connector. Note that it is very important to understand the schema mappings of payload that will be submitted from the app to the Data Cloud.
  • Once the first two steps are completed, you can then send a JSON message confirming a particular event to Data Cloud to ensure that the connection is working properly.

Screenshot of Mobile SDK schema and connection in Data Cloud Setup

  • Next, map the data lake objects (DLOs) as defined above to the canonical data model objects (DMOs).
  • Using real-time data graphs Profile API, you can visualize the user engagement clicks in Salesforce UX for a contact.

Screenshot of user engagement clicks querying data graphs in real time in the Salesforce LWC UX

  • Finally, utilize product recommendations with either goal-based or rule-based content to deliver personalized experiences to users, including targeted recommendations or custom content.

Screenshot of personalized content from Salesforce displayed in the iOS app.

Watch a recording of the real-time Salesforce Personalization implementation in action.

Empowering service with Agentforce

Messaging for In-App and Web (MIAW) is a Salesforce feature that enables real-time, context-aware communication between users and customer support agents directly within mobile apps and web interfaces.

Screenshot of the Acme mobile app showing a conversation with an agent, where in runtime we can check the user’s behavioral event clicks in Data Cloud DMOs and suggest a hyper-personalized message.

In the first orchestration, we captured user clicks and interactions within the app, which were instantly propagated to Data Cloud, enabling real-time insights in sub-second time frames. At this point, we had enough data points for agentic AI to intelligently predict user needs and proactively offer tailored support via mobile interactions. Through flows and Prompt Builder, our agents had immediate context-specific actions and topic recommendations, dramatically enhancing customer satisfaction and reducing resolution times.

Key implementation steps

Below are the configuration steps needed to set up a MIAW omni-channel flow in a Salesforce org, which will integrate with an Agentforce agent and integrate into your mobile iOS app.

  • From Salesforce Setup, go to Embedded Service Deployments and create a service deployment for the “mobile” type.

Screenshot of the MIAW embedded service deployment setup

  • Get the code from the deployment configuration as you will need it in your mobile app.

Screenshot of the mobile configuration file in Salesforce org to be referenced in the iOS app

  • Paste the key-value pair values in the config file in the mobile app.

Screenshot of the config file being attached in the iOS app

  • Load the configuration file in your Swift view.

Screenshot of dynamically loading the config file using the iOS Swift function

  • Create a flow that routes customer messages to the Agentforce Service Agent.

Screenshot of the MIAW omni-flow referencing Agentforce Service Agent

The last step of the MIAW omni channel flow is to invoke an Agentforce Service Agent. Below, are the basic steps to create a Prompt Template and an agent. To get started on building agents, please see the Resources section below.

  • Create a prompt template and test it; the prompt template is hydrated with engagement data.

Screenshot of the Customer Product Interest prompt template hydrated with the engagement data from Data Cloud and relevant prompts

  • Create a topic or topics for the agent.

Screenshot of the Topics section in Agent Builder, and one of the steps is injecting the Customer Product Assistant topic.

  • Create or associate a topic action to the topic.

Screenshot of calling the Customer Product Interest Topic action for the Customer Product Assistant topic

Watch a recording of the MIAW and Agentforce implementation in action.

Harnessing unstructured data with Data Cloud Vector Database

Screenshot of the Acme mobile app capturing different kinds of reviews, which will be stored in Data Cloud via Ingestion API

Data Cloud’s vector database is a specialized database designed to store, analyze, and retrieve unstructured data. Customer feedback, such as reviews or support inquiries, is often challenging to utilize effectively. Using Data Cloud’s Vector Database, we transformed this feedback into actionable insights.

The app has the capability for users to submit unstructured feedback like reviews or comments. We can easily extend it to capture any blob and unstructured data directly through the mobile app into Data Cloud’s Vector Database via the Ingestion API. Once the data is stored as data model object (DMO) records, we can create search indexes on the DMO for chunking and use retrievers or Apex to hydrate the chunks into prompt templates to perform sentimental analysis and categorization, and derive deeper insights that will be put into a feedback loop to create product promotions or case creation in a proactive way.

Key implementation steps

Let’s deep dive into some of the configuration steps required to connect to Data Cloud’s Vector Database in your mobile app.

NOTE: For any application to communicate with Data Cloud, you need a JWT bearer token for authentication. You can see a sample implementation in this GitHub repository. You can run this as a serverless app in any infrastructure in a secure way. This is a pre-requisite for submitting Ingestion API payloads to Data Cloud.

  • Create an ingestion API connector in your Data Cloud org.

Screenshot of the Ingestion API setup in Data Cloud for ingesting customer reviews from an iOS app

  • Invoke the REST endpoint from the app.

Screenshot of the Swift function to transmit the customer reviews payload from an iOS app to Data Cloud

  • Create a DLO-to-DMO mapping.

Screenshot of the Ingestion API’s DLO-to-DMO mapping

  • Verify that the data is showing up as DMO records.

Screenshot showing the customer reviews data in a Data Cloud DMO

  • Create a search index and a retriever, or use our pro-code tool Apex, to query the chunk DMO, which will act as a vector retriever.

Screenshot of the search index on the Customer Reviews chunk table

  • Finally, create a prompt template to get a sentiment of reviews (as an example).

Screenshot of the Customer Reviews prompt template hydrated with an unstructured chunk to identify customer sentiment

Watch a recording of the unstructured orchestration implementation in action.

Conclusion

As we’ve seen in this post, integrating Data Cloud with an iOS mobile app allows our example fictitious business Acme to deliver personalized, responsive, and intelligence-driven user experiences in it’s mobile storefront application. Combining Salesforce Personalization, real-time Agentforce integration, and unstructured data management sets a new standard for personalizing, engaging, and helping users.

Resources

About the Author

Arup Sarkar is a Distinguished Technical Architect working in the Data Cloud and AI Specialist Distribution team. Reach out to him on LinkedIn.

Special thanks to Brendan Sheridan for configuring the MIAW deployment setup and creating the omni-flow. Brendan is a Principal Solutions Engineer who consults directly with media industry clients on Service Cloud solutions, including leveraging the power of AI to enhance customer service. Reach out to him on LinkedIn.

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS