Skip to content

Latest commit

 

History

History
486 lines (345 loc) · 12.3 KB

xamarin-maui-apis.md

File metadata and controls

486 lines (345 loc) · 12.3 KB

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

IPendoServiceIPendoService
Setupvoid
StartSessionvoid
SetVisitorDatavoid
SetAccountDatavoid
EndSessionvoid
Trackvoid
PauseGuidesvoid
ResumeGuidesvoid
DismissVisibleGuidesvoid
GetDeviceIdstring
GetVisitorIdstring
GetAccountIdstring
SetDebugModevoid
ScreenContentChangedvoid

IPendoInterface APIs

IPendoService

interface IPendoService

The interface of the Pendo shared instance.

Details - Click to expand or collapse

Example:

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

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:

Pendo.Setup("your.app.key");  

StartSession

void StartSession(string visitorId, string accountId, Dictionary<string, object> visitorData, Dictionary<string, object> 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<string, object> Additional visitor metadata
accountData Dictionary<string, object> Additional account metadata

Example:

var visitorData = new Dictionary<string, object>
{
    { "age", 21 },
    { "country", "USA" }
};

var accountData = new Dictionary<string, object>
{
    { "Tier", 1 },
    { "Size", "Enterprise" }
};

Pendo.StartSession("John Doe", "ACME", visitorData, accountData);

SetVisitorData

void SetVisitorData(Dictionary<string, object> 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<string, object> The visitor metadata to be updated

Example:

var visitorData = new Dictionary<string, object>
{
    { "age", 25 },
    { "country", "UK" },
    { "birthday", "01-01-1990" }
};

Pendo.SetVisitorData(visitorData);

SetAccountData

void SetAccountData(Dictionary<string, object> 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<string, object> The account metadata to be updated

Example:

var accountData = new Dictionary<string, object>
{
    { "Tier", 2 },
    { "size", "Mid-Market" },
    { "signing-date", "01-01-2020" }
};

Pendo.SetAccountData(accountData);

EndSession

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:

Pendo.EndSession(); 

Track

void Track(string eventName,
Dictionary<string, object> 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<string, object> Additional metadata to be sent as part of the track event

Example:

var trackEventProperties = new Dictionary<string, object>
{
    { "Theme", "Dark Mode" },
};

Pendo.Track("App Opened", trackEventProperties);

PauseGuides

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:

Pendo.PauseGuides(false);

ResumeGuides

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:

Pendo.ResumeGuides();

DismissVisibleGuides

void DismissVisibleGuides()

Dismisses any visible guide.

Details
Interface: IPendoService
Class: PendoAndroidService/PendoiOSService
Kind: class method
Returns: void
Example:
Pendo.DismissVisibleGuides();

GetDeviceId

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:
Pendo.GetDeviceId();

GetVisitorId

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:
Pendo.GetVisitorId();

GetAccountId

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:
Pendo.GetAccountId();

SetDebugMode

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:

Pendo.SetDebugMode(true);
Pendo.Setup("your.app.key");

ScreenContentChanged

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:
Pendo.ScreenContentChanged();