Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by theo · May 19 at 03:22 PM · unity3dMatchmakingandroid

Implementing Lobby notifications with C# and Microsoft.AspNetCore.SignalR.Client

Hi,

I'm trying to add matchmaking to our cross-platform game. It must run on android, so I had to generate C# code from the Rest API and as far as I've tested, it's running well. The pain point at the moment is the real time notifications for the lobby and matchmaking API.

I have managed to connect to the SignalR Hub using Microsoft.AspNetCore.SignalR.Client lib, but I fail to understand how to start a session as described here.

The relevant code section looks like this

_connection = new HubConnectionBuilder()
    .WithUrl("https://mygameid.playfabapi.com/pubsub", ConfigureHttpConnection)
    .Build();

_connection.On<string, string>("ReceiveMessage", (user, message) =>
{
    Debug.Log(user + "; " + message);
});

_connection.On<string, string>("ReceiveSubscriptionChangeMessage", (user, message) =>
{
    Debug.Log(user + "; " + message);
});

try
{
    await _connection.StartAsync();

    string payload = "{\"type\": 1, \"target\": \"StartOrRecoverSession\", \"arguments\": [{\"oldConnectionHandle\": \"\", \"traceParent\": \"00-84678fd69ae13e41fce1333289bcf482-22d157fb94ea4827-01\"}]}";
    var responseString = await _connection.InvokeAsync<string>("StartOrRecoverSession", payload);

    if (responseString != null)
    {
        Debug.Log(responseString);
    }
}
catch (Exception ex)
{
    Debug.Log(ex.Message);
}

From what I've read so far, I feel like I should pass the argument to StartOrRecoverSession this way. I've also tried without any arguments or by supplying the two expected string directly but none of that works.

This post was my entry point about Unity and SignalR and then I tried to make sense of this.

Do you have any idea what I could be missing ?

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Gosen Gao · May 20 at 09:58 AM

We are not expert on SignalR. For the issues about configuring SignalR, please contact Azure for professional support.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Where can I find an Android/Unity compatible version of Multiplayer SDK ? 2 Answers

    Unity, PlayFab, and Photon - Players do not see each other when joining rooms 1 Answer

    Got Server and Port, but unable to connect or ping to it 0 Answers

    Missing PlayFab assembly reference. 1 Answer

    Cannot start my custom server from the PlayFabClientAPI,Сannot start my custom server from the PlayFabClientAPI 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges