in my webgl code, I’m trying to get convainpc.sessionid, but it is always -1 even after i can see the session id change in thebrowser console (from JS call?)
it seems like it isn’t updating after initialization, is there a better place to pull this sessionid?
K3
February 3, 2025, 5:40pm
2
Hello @chris.raasch ,
Currently, ConvaiNPC.cs does not update with the latest session ID .
The Session ID you see in the browser log comes from a console.log message in JSLib .
To properly pass the Session ID to ConvaiGRPCWebAPI , modify Assets/Convai/Plugins/WebGL/ConvaiUnityWebGL.jslib by adding a SendMessage call.
Find this section in your JSLib code and insert the SendMessage function:
if (responseText != "") {
console.log("Response Text: " + responseText);
console.log("Session ID: ", response.getSessionId());
// Example
SendMessage("ConvaiGRPCWebAPI", "SessionIDReceived", response.getSessionId());
}
Also, ensure that ConvaiGRPCWebAPI has a method called SessionIDReceived to properly handle the session ID update.
system
Closed
March 5, 2025, 5:41pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.