Firstly, I'm unable to use The Multiplayer SDK because I'm using Unity WebGL (as per this answered question).
I'm attempting to get realtime lobby updates. I can't use the GetLobby REST API because it seems to throttle my calls at around a call every eight seconds.
I'm opting to use Realtime notifications, as advised in the answer to this question.
It's my understanding that I must use SignalR to use PlayFab's realtime notifications. I have successfully included the ASP.NET Core SignalR .Net Client in my Unity project using this guide. I understand I'll probably need to use javascript for WebGL, but I'm getting things set up in the Unity editor first using the C Sharp version.
I'm attempting to follow this documentation to connect to the SignalR hub. I'm creating a HubConnection in C Sharp like this:
string url = $"https://9EBFC.playfabapi.com/pubsub"; m_connection = new HubConnectionBuilder().WithUrl(url).Build();
'9EBFC' is our title ID. The following exception is thrown by the connection upon calling m_connection.StartAsync:
HttpRequestException: 401 (Unauthorized)
Am I correct in assuming the SignalR negotiate REST API must be passed in as the URL of my SignalR connection, as I have done in my code snippet? Am I correct in assuming 'titleId' part of the URL in the previous API documentation must be replaced with my title's title ID? I get the same error if I instead use the literal string 'https://titleId.playfabapi.com/PubSub/Negotiate'.
The Real-time notifications SignalR Hub documentation previously linked mentions the auth headers required to call the API can be passed to the SignalR client via HttpConnectionOptions. How, specifically, might I do that? I know I must use this overload of the WithURL method, but what should I add during the HttpConnectionOptions callback? Are there any examples? I have looked at the PlayFab messaging sample, which isn't quite the same thing, but it does use that overload. It seems to pass an access token it retrieves from a CloudScript call. Must I use Cloudscript, or is that not relevant for getting realtime lobby updates?