---
schema_version: "1"
id: 8537150dbd5311d898391193eb6dac2f3ac0d32cebca7675cde0ca09faf8afd7
title: AgentforcePageContextProviding
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/ios/agentforce-page-context-providing-ios.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-page-context-providing-ios.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3be2d4aba488f235eed937acae08a544cf8d843413ea736ca92a67d6cfec084d
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforcePageContextProviding

`protocol AgentforcePageContextProviding`

Protocol for providing page context information to the Agentforce SDK.

## Overview

This protocol enables the SDK to understand the current application context, including which Salesforce object, record, or page the user is viewing. This context information is crucial for providing relevant AI responses, suggesting appropriate actions, and maintaining conversation relevance.

## Declaration

```swift
protocol AgentforcePageContextProviding
```

## Properties

| Property    | Type                   | Description                          |
| ----------- | ---------------------- | ------------------------------------ |
| pageContext | AgentforcePageContext? | The current page context information |

## Example Implementation

```swift
class NavigationContextProvider: AgentforcePageContextProviding {
    var pageContext: AgentforcePageContext? {
        // Return context based on current navigation state
        guard let currentObject = navigationManager.currentObject else { return nil }
        return AgentforcePageContext(
            appName: "Sales Cloud",
            objectApiName: currentObject.apiName,
            attributes: [
                "recordId": navigationManager.currentRecordId,
                "pageType": navigationManager.currentPageType
            ]
        )
    }
}
```
