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
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
Android orientation example
Opening and closing
OpenSupport
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
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
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
EnableNotifications
DisableNotifications
RegisterPushToken
PushTokenType.FCM and PushTokenType.APNS are allowed values for the type argument. See push notifications for more information.
HandleNotification
HandlePendingNotificationAction
HasPendingNotificationAction
IsTheymesNotification
Config
GetLanguage
null if no language is set.
SetLanguage
GetPlayer
null if no player information is set.
SetPlayer
GetSignedMetadataToken
SetSignedMetadataToken
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
SetTags
AddTag
AddTags
RemoveTag
RemoveTags
RemoveAllTags
Breadcrumbs
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 byClearBreadcrumbs() and Reset().
AddBreadcrumb
AddBreadcrumbs
ClearBreadcrumbs
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 isobject, 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
SetFields
AddField
AddFields
RemoveField
RemoveFields
RemoveAllFields
Privacy
IsYoungPlayer
true if the player is set as a young player, otherwise false.
SetYoungPlayer
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
true if the privacy mode is enabled, otherwise false.
SetPrivacyMode
Other
true if the help center is supported on the current platform, otherwise false.
GetSdkVersion
GetNativeSdkVersion
Reset
GetUnreadMessageCount
GetUnansweredMessageCount
Events
All events are always called in the main thread.onOpen
onClose
onUnreadMessageCountUpdated
onUnansweredMessageCountUpdated
onSignedMetadataTokenExpirationUpdated
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.