# MAUI public developer API documentation > [!IMPORTANT] >The `Setup` API must be called before the `StartSession` API.
> All other APIs must be called after both the `Setup` and `StartSession` APIs, otherwise they will be ignored.
>The `SetDebugMode` API is the exception to that rule and may be called anywhere in the code. ### IPendoInterface APIs [IPendoService](#ipendoservice) ⇒ `IPendoService`
[Setup](#setup) ⇒ `void`
[StartSession](#startsession) ⇒ `void`
[SetVisitorData](#setvisitordata) ⇒ `void`
[SetAccountData](#setaccountdata) ⇒ `void`
[EndSession](#endsession) ⇒ `void`
[Track](#track) ⇒ `void`
[PauseGuides](#pauseguides) ⇒ `void`
[ResumeGuides](#resumeguides) ⇒ `void`
[DismissVisibleGuides](#dismissvisibleguides) ⇒ `void`
[GetDeviceId](#getdeviceid) ⇒ `string`
[GetVisitorId](#getvisitorid) ⇒ `string`
[GetAccountId](#getaccountid) ⇒ `string`
[SetDebugMode](#setdebugmode) ⇒ `void`
[ScreenContentChanged](#screencontentchanged) ⇒ `void`
## IPendoInterface APIs ### `IPendoService` ```c# interface IPendoService ``` >The interface of the Pendo shared instance.
Details - Click to expand or collapse
Example: ```c# using PendoSDKXamarin; namespace ExampleApp { public partial class App : Application { IPendoService Pendo = PendoServiceFactory.CreatePendoService(); /** if your app supports additional Platforms other than iOS and Android verify the Pendo instance is not null */ if (pendo != null) { // pendo related code } // the rest of your code } } ```
### `Setup` ```c# void Setup(string appKey) ``` >Establishes a connection with Pendo’s server. Call this API in your application’s OnStart() method. The setup method can only be called once during the application lifecycle. Calling this API is required before tracking sessions or invoking session-related APIs.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:------:|:------:|:-------------------------------------------------------------------------| | appKey | string | The App Key is listed in your Pendo Subscription Settings in App Details | Example: ```c# Pendo.Setup("your.app.key"); ```
### `StartSession` ```c# void StartSession(string visitorId, string accountId, Dictionary visitorData, Dictionary accountData) ``` >Starts a mobile session with the provided visitor and account information. If a session is already in progress, the current session will terminate and a new session will begin. The termination of the app will also terminate the session. >To generate an anonymous visitor, pass `null` as the visitorId. Visitor data and Account data are optional. > No action will be taken if the visitor and account IDs do not change when calling the startSession API during an ongoing session.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:-----------:|:--------------------------:|:---------------------------------------------------------------| | visitorId | string | The session visitor ID. For an anonymous visitor set to `null` | | accountId | string | The session account ID | | visitorData | Dictionary | Additional visitor metadata | | accountData | Dictionary | Additional account metadata | Example: ```c# var visitorData = new Dictionary { { "age", 21 }, { "country", "USA" } }; var accountData = new Dictionary { { "Tier", 1 }, { "Size", "Enterprise" } }; Pendo.StartSession("John Doe", "ACME", visitorData, accountData); ```
### `SetVisitorData` ```c# void SetVisitorData(Dictionary visitorData) ``` >Updates the visitor metadata of the ongoing session.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:-----------:|:--------------------------:|:-----------------------------------| | visitorData | Dictionary | The visitor metadata to be updated | Example: ```c# var visitorData = new Dictionary { { "age", 25 }, { "country", "UK" }, { "birthday", "01-01-1990" } }; Pendo.SetVisitorData(visitorData); ```
### `SetAccountData` ```c# void SetAccountData(Dictionary accountData) ``` >Updates the account metadata of the ongoing session.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:-----------:|:--------------------------:|:-----------------------------------| | accountData | Dictionary | The account metadata to be updated | Example: ```c# var accountData = new Dictionary { { "Tier", 2 }, { "size", "Mid-Market" }, { "signing-date", "01-01-2020" } }; Pendo.SetAccountData(accountData); ```
### `EndSession` ```c# void EndSession() ``` >Ends the active session and stops collecting analytics or showing guides to the user. A new session can be started by calling the startSession API. >This API is commonly used when the user logs out of your application.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
Example: ```c# Pendo.EndSession(); ```
### `Track` ```c# void Track(string eventName, Dictionary trackData) ``` >Sends a track event with the specified properties.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:----------:|:--------------------------:|:----------------------------------------------------------| | eventName | string | The track event name | | properties | Dictionary | Additional metadata to be sent as part of the track event | Example: ```c# var trackEventProperties = new Dictionary { { "Theme", "Dark Mode" }, }; Pendo.Track("App Opened", trackEventProperties); ```
### `PauseGuides` ```c# void PauseGuides(bool dismissGuides) ``` >Pauses any guides from appearing during an active session. If the `DismissGuides` value is set to `true`, then any visible guide will be dismissed. Calling this API affects the current session. Starting a new session reverts this logic, enabling guides to be presented.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:-------------:|:----:|:------------------------------------------------------------------------------------------------------------------------| | dismissGuides | bool | Determines whether the displayed guide, if one is visible, is dismissed when pausing the display of the further guides | Example: ```c# Pendo.PauseGuides(false); ```
### `ResumeGuides` ```c# void ResumeGuides() ``` >Resumes displaying guides during the ongoing session. This API reverses the logic of the `PauseGuides` API.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
Example: ```c# Pendo.ResumeGuides(); ```
### `DismissVisibleGuides` ```c# void DismissVisibleGuides() ``` >Dismisses any visible guide.
Details
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
Example: ```c# Pendo.DismissVisibleGuides(); ```
### `GetDeviceId` ```c# string GetDeviceId() ``` >Returns the device's unique Pendo-generated ID.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: String
Example: ```c# Pendo.GetDeviceId(); ```
### `GetVisitorId` ```c# string GetVisitorId() ``` >Returns the ID of the visitor in the active session.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: string
Example: ```c# Pendo.GetVisitorId(); ```
### `GetAccountId` ```c# string GetAccountId() ``` >Returns the ID of the account in the active session.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: string
Example: ```c# Pendo.GetAccountId(); ```
### `SetDebugMode` ```c# void SetDebugMode(bool isDebugEnabled) ``` >Enable/disable debug logs from Pendo SDK. To debug the Pendo SDK we recommend calling this API before calling the setup API. >Debug logs are turned off by default. Releasing your production app with the debug logs enabled is not recommended and may have performance repercussions on your app.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
| Param | Type | Description | |:--------------:|:----:|:-------------------------------------------------------| | isDebugEnabled | bool | Set to `true` to enable debug logs, `false` to disable | Example: ```c# Pendo.SetDebugMode(true); Pendo.Setup("your.app.key"); ```
### `ScreenContentChanged` ```c# void ScreenContentChanged() ``` >Rescans the page enabling the Pendo SDK to identify changes that have occurred since the page loaded. >Using this API is required to display tooltip guides and fix inaccurate analytics on elements that weren't present, or have been modified since the initial page load. >The API does not generate an additional page load event.
Details - Click to expand or collapse
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
Example: ```c# Pendo.ScreenContentChanged(); ```