I am trying to resubmit a UWP application (written in C # / XAML) to a Microsoft repository so that it supports "Windows 10 Xbox" in addition to the previously supported Windows Desktop and Windows Phone. I can deploy (using Visual Studio 2017) and run the application on my Xbox One console in developer mode without any problems. When I send to the store, I get the following error:
Since your game uses Xbox Live, it must:
ยท Create at least one active user and sign up for the user on Xbox.
ยท Display Xbox gamertag users as the primary display and profile name.
Please add this behavior and resubmit your game.
I am looking for a minimal C # / XAML example that shows me how to solve this send problem.
The Raw Gamer Profile "profile access message seems to indicate that I can take care of the login by doing something like this:
if (App is running on Xbox)
{
XboxLiveUser user = new XboxLiveUser();
SignInResult result = await user.SignInAsync();
}
but I'm not sure if this is correct or how I can determine if the application is running on Xbox.
In addition, I would like to know how and where I should display the user game server. Can I just display it anywhere in XAML? Also, is there any special Xbox api I need to call in order to display this?
, #/XAML, , , , Xbox, , Microsoft Store.
Update:
:
Nuget, Microsoft.Xbox.Live.SDK.WinRT.UWP\
xboxservices.config 6
TextBlock gamertag:
public static async void InitializeXboxGamer(TextBlock gamerTagTextBlock)
{
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.Contains("Xbox"))
{
XboxLiveUser user = new XboxLiveUser();
SignInResult result = await user.SignInSilentlyAsync(Window.Current.Dispatcher);
if (result.Status == SignInStatus.UserInteractionRequired)
{
result = await user.SignInAsync(Window.Current.Dispatcher);
}
gamerTagTextBlock.Text = user.Gamertag;
gamerTagTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
else
{
gamerTagTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
}
}
:
: 10.13.5 Xbox Live Active User Gamertag
Xbox Live, : ยท Xbox. ยท Xbox gamertag . , . Xbox Live . , .
: Windows 10 Desktop, Windows 10 Xbox
, ?