Access Raw Gamer's Profile Profile

I am using the new XBox Live API for C # ( https://github.com/Microsoft/xbox-live-api-csharp ) for official access through the UWP application.

I can authenticate and point the Xbox Live user in context.

SignInResult result = await user.SignInAsync(); 
XboxLiveUser user = new XboxLiveUser();

Success! However, I cannot find a suitable API call to return XboxUserProfile or XboxSocialProfile. Both of these classes contain URLs for played players. After reviewing the MSDN documentation and the GH library, it is not clear to me how this is achieved. Any help is appreciated.

+3
source share
1 answer

The following sample should work if you meet the following prerequisites:

  • , API, "Microsoft.Xbox.Services.UWP.CSharp"
  • Microsoft.Xbox.Services.UWP.CSharp .
  • Newtonsoft.Json NuGet

1 2 , "" , .

:

        XboxLiveUser user = new XboxLiveUser();
        await user.SignInSilentlyAsync();

        if (user.IsSignedIn)
        {
            XboxLiveContext context = new XboxLiveContext(user);
            PeopleHubService peoplehub = new PeopleHubService(context.Settings, context.AppConfig);
            XboxSocialUser socialuser = await peoplehub.GetProfileInfo(user, SocialManagerExtraDetailLevel.None);
            // Do whatever you want to do with the data in socialuser
        }

, . :

CS0103 "UserPicker" ... \System\UserImpl.cs 142 Active

, , Win 10.0 Build 14393.

+2

Source: https://habr.com/ru/post/1692190/


All Articles