Last active
August 26, 2021 16:51
-
-
Save vlussenburg/ac9e7f82aec122f22a17b599b154fedd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize with appropriate values for your game | |
Dictionary<string, string> userDetails = new Dictionary<string, string> | |
{ | |
{ "userId", "BestPlayerEver" }, | |
{ "userEmail", "[email protected]" }, | |
{ "userName", "Bob" } | |
}; | |
HelpshiftSdk.Login(userDetails); | |
BacktraceClient BacktraceClient = GameObject.Find("Backtrace").GetComponent<BacktraceClient>(); | |
var configMap = new Dictionary<string, object>(); | |
// Add backtrace GUID so Helpshift and Backtrace are linked | |
Dictionary<string, string> backtraceid = new Dictionary<string, string>(); | |
backtraceid.Add("type", "singleline"); | |
backtraceid.Add("value", BacktraceClient["guid"]); | |
// Other example values | |
Dictionary<string, string> playerlevel = new Dictionary<string, string>(); | |
playerlevel.Add("type", "number"); | |
playerlevel.Add("value", "35"); | |
Dictionary<string, string> playerspend = new Dictionary<string, string>(); | |
playerspend.Add("type", "number"); | |
playerspend.Add("value", "1750"); | |
Dictionary<string, string> playerid = new Dictionary<string, string>(); | |
playerid.Add("type", "singleline"); | |
playerid.Add("value", "BestPlayerEver"); | |
Dictionary<string, string> playersegment = new Dictionary<string, string>(); | |
playersegment.Add("type", "multiline"); | |
playersegment.Add("value", "vip"); | |
Dictionary<string, object> cifDictionary = new Dictionary<string, object>(); | |
cifDictionary.Add("device_id", backtraceid); | |
cifDictionary.Add("level", playerlevel); | |
cifDictionary.Add("lifetime_spend", playerspend); | |
cifDictionary.Add("player_id", playerid); | |
cifDictionary.Add("segment", playersegment); | |
configMap.Add("customIssueFields", cifDictionary); | |
// Show in-app conversation UI | |
HelpshiftSdk.ShowConversation(configMap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment