Skip to main content
All the Theymes SDK methods are static and can be called using the TheymesSdk class. The TheymesSdk class is located in the Theymes namespace.
ImportantBefore you can use any other functions of the SDK, you must initialize it by calling the TheymesSdk.Initialize() method. See Installing the SDK for more information.

Initialization

Initialize

The TheymesSdk.Initialize() method initializes the SDK with the given token and domain. The third parameter options is optional. options.web configures WebGL-specific behavior and is ignored on iOS and Android. options.android configures Android-specific behavior and is ignored on iOS and WebGL. InitializeOptions InitializeWebOptions InitializeAndroidOptions Orientation constants If you want to use other orientations on Android, you can also pass the corresponding integer from the ActivityInfo class.
Example
See Configuring the SDK - WebGL options for more information.
Android orientation example
See Configuring the SDK - Android options for more information.

Opening and closing

OpenSupport

The TheymesSdk.OpenSupport() method opens the help center. The help center is opened on top of the current scene. OpenSupportAsync() is available on all supported Unity platforms. On iOS and Android, it behaves the same as OpenSupport(), so it does not matter which one you use. On Windows, macOS, Linux, and in the Unity Editor, you can await it if you want to show loading UI while the SDK creates a support session before opening the public support site in the system browser. TheymesConfig can optionally be used to customize the help center. See Configuring the SDK for more information.

OpenResource

Opens a specific resource from Theymes. This can be an article such as a game guide or patch notes, or a collector to gather feedback or bug reports from players. The player is returned to the game after interacting with the resource. OpenResourceAsync() is available on all supported Unity platforms. On iOS and Android, it behaves the same as OpenResource(), so it does not matter which one you use. On Windows, macOS, Linux, and in the Unity Editor, you can await it if you want to show loading UI while the SDK creates a support session for the resource shortcut before opening the public support site in the system browser. You can get the value for resource argument from Theymes application, for example TheymesSdk.OpenResource("crafting-guide"). TheymesConfig can optionally be used to customize the resource. See Configuring the SDK for more information.

Close

Can be used to close the help center or any other resource that is opened with TheymesSdk.OpenResource(). Normally you don’t need to call this method, as the player will see a close button in the SDK UI, but if you need to close the resource programmatically, you can use this method.

Notifications

Notifications can be shown to user when there’s a new message in their open tickets. Typically you would call EnableNotifications() when transitioning to game menus or other screens where the player is not actively playing, and DisableNotifications() when transitioning to gameplay.Notifications are disabled by default.

RequestNotificationPermission

Requests permission to show notifications to the player. Should be called as part of game initialization flow.

EnableNotifications

Enables in-game notifications to be shown to the player.

DisableNotifications

Disables in-game notifications to be shown to the player.

RegisterPushToken

Registers a device push token with Theymes to allow sending push notifications to the user. PushTokenType.FCM and PushTokenType.APNS are allowed values for the type argument. See push notifications for more information.

HandleNotification

Handles incoming push notification. Only necessary to call on Android with FCM, but can also be called for other platforms, which will be noop. See push notifications for more information.

HandlePendingNotificationAction

Handles pending notification actions from background notification taps. See push notifications for more information.

HasPendingNotificationAction

Checks whether there’s a pending notification action. See push notifications for more information.

IsTheymesNotification

Checks whether a notification is targeted for Theymes.

Config

GetLanguage

Returns the currently set language, or null if no language is set.

SetLanguage

Sets the language in which the help center will be displayed.

GetPlayer

Returns the currently set player information, or null if no player information is set.

SetPlayer

Sets the player information. See Configuring the SDK for more information.

GetSignedMetadataToken

Returns the currently set signed metadata token. See Player Verification for more information.

SetSignedMetadataToken

Sets the player information. See Configuring the SDK for more information.

Tags

Tags can be used to send additional information to Theymes. The tag must be configured in the Theymes application first or otherwise it will be ignored.

GetTags

Returns the currently set tags.

SetTags

Overwrites the currently set tags with the new list of tags.

AddTag

Appends a new tag to the currently set tags.

AddTags

Appends new tags to the currently set tags.

RemoveTag

Removes a tag from the currently set tags.

RemoveTags

Removes tags from the currently set tags.

RemoveAllTags

Removes all currently set tags. Breadcrumbs are short diagnostic messages that are timestamped automatically and sent when opening support or a resource. They are kept in memory only and are cleared by ClearBreadcrumbs() and Reset().

AddBreadcrumb

Appends a breadcrumb to the current breadcrumb list.

AddBreadcrumbs

Appends multiple breadcrumbs to the current breadcrumb list.

ClearBreadcrumbs

Removes all currently set breadcrumbs.

Fields

Fields are a set of key-value pairs that can be used to send additional information to Theymes. The field must be configured in the Theymes application first or otherwise it will be ignored. The value type for the fields is object, but accepted values are booleans, strings, numbers and lists of strings. The type must match the type configured in Theymes or it will be ignored.

GetFields

Returns the currently set fields.

SetFields

Overwrites the currently set fields with the new list of fields.

AddField

Appends a new field to the currently set fields.

AddFields

Appends new fields to the currently set fields.

RemoveField

Removes a field from the currently set fields.

RemoveFields

Removes fields from the currently set fields.

RemoveAllFields

Removes all currently set fields.

Privacy

IsYoungPlayer

Returns true if the player is set as a young player, otherwise false.

SetYoungPlayer

Sets whether the player is a young player.
Setting the player as a young player will also enable the privacy mode, you do not need to call SetPrivacyMode(true) separately. Additionally support agents will see that they are talking to a young player and can handle the conversation accordingly.

IsPrivacyMode

Returns true if the privacy mode is enabled, otherwise false.

SetPrivacyMode

Sets whether the privacy mode is enabled.

Other

Returns true if the help center is supported on the current platform, otherwise false.

GetSdkVersion

Returns the version of the Unity SDK package.

GetNativeSdkVersion

Returns the underlying native SDK version on iOS, Android, and WebGL. On standalone/editor builds this returns the Unity SDK package version.

Reset

Resets the SDK to its initial state. This can be useful if you have a logout flow and you want to clear all the player, fields, tags and breadcrumbs state.

GetUnreadMessageCount

Returns the number of unread messages. You can use this to update your game’s UI to show an indicator or badge for unread messages.

GetUnansweredMessageCount

Returns the number of unanswered messages. You can use this to update your game’s UI to show an indicator or badge for unanswered messages.

Events

All events are always called in the main thread.

onOpen

Called whenever the help center is opened.

onClose

Called whenever the help center is closed.

onUnreadMessageCountUpdated

Called whenever the number of unread messages changes. You can use this to update your game’s UI to show an indicator or badge for unread messages.

onUnansweredMessageCountUpdated

Called whenever the number of unanswered messages changes. You can use this to update your game’s UI to show an indicator or badge for unanswered messages.

onSignedMetadataTokenExpirationUpdated

Called only when a signed metadata token is set. The event is called immediately when the game comes to the foreground and then once a minute while the game stays in the foreground. The callback receives the remaining expiration time in seconds. If the token is already expired, the value is 0 or negative. Your game decides when to refresh the token based on this value. The value is calculated from the client’s clock, so if the clock is not in sync, the reported expiration time is skewed too.