- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将 UWP 应用程序(用 C#/XAML 编写)重新提交到 Microsoft 商店,以便它除了以前支持的 Windows 桌面和 Windows Phone 之外还支持“Windows 10 Xbox”。我可以在开发人员模式下在我的 Xbox One 控制台上部署(使用 Visual Studio 2017)和运行该应用程序,没有任何问题。当我提交到商店时,出现以下错误:
Because your game uses Xbox Live, it must:
· Create at least one active user and sign the user into Xbox.
· Display the user’s Xbox gamertag as the primary display and profile name.Please add this behavior and resubmit your game.
我正在寻找一个最小的 C#/XAML 示例来说明如何解决此提交问题。
The post on "Accessing Raw Gamer Profile Picture"似乎表明我可以通过执行以下操作来处理登录:
if (App is running on Xbox)
{
XboxLiveUser user = new XboxLiveUser();
SignInResult result = await user.SignInAsync();
}
但我不确定这是否正确,或者我如何确定该应用程序正在 Xbox 上运行。
此外,我想知道应该如何以及在何处显示用户的玩家代号。我可以只在 XAML 中的任何位置显示它吗?或者,是否需要调用一些特殊的 Xbox API 来显示它?
简而言之,我需要一个非常简单的 C#/XAML 示例,展示如何执行检查应用程序是否在 Xbox 上运行、登录用户以及在适当位置显示用户玩家代号等最低要求,这样我就可以满足 Microsoft Store 的要求。
更新:我做了以下事情:
使用 Nuget 包管理器,我安装了 Microsoft.Xbox.Live.SDK.WinRT.UWP\
在项目中,我在Section 6 of these instructions 之后创建了一个xboxservices.config 文件。
我在屏幕的左上角创建了一个 TextBlock 控件,并将其传递给以下函数以显示玩家代号:
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;
}
}
然而,这仍然未能通过提交测试,并出现以下错误:
App Policies: 10.13.5 Xbox Live Active User and Gamertag
Notes To Developer
Because your game uses Xbox Live, it must: · Create at least one active user and sign the user into Xbox. · Display the user’s Xbox gamertag as the primary display and profile name. Please add this behavior and resubmit your game. You can view the Xbox Live documentation for more information. Your game may not appear in the Creators Collection until this has been resolved.
Tested Devices: Windows 10 Desktop, Windows 10 Xbox
关于我在这里做错了什么有什么想法吗?
最佳答案
经过大量研究并回顾了上面的有用答案,我发现了以下两种方式让 Windows 通用应用获得 Microsoft Store 批准以在 Xbox One 上运行。第二种方法(见下文)展示了如何通过在应用程序中显示玩家代号来执行此操作。
要在不使用“Xbox Live”(并显示玩家代号)的情况下获得 Xbox 批准的应用,您需要通过 "Concept Approval"过程。您可以通过填写 ID@XBOX application 开始
或者,您可以通过将“Xbox Live”集成到您的 UWP 应用程序中,通过执行以下操作在您的应用程序中显示玩家代号来获得应用程序的批准:
确保您的项目(右键单击您的项目->应用程序)设置为“Windows 10 Creators Update (10.0; Build 15063)”的最低版本和“Windows 10 Fall Creators Update (10.0; Build 15063)”的目标版本。 Build 16299)”——否则,当您在下面添加 NuGet 包时,将不会出现对“Microsoft.Xbox.Services.winmd”的引用。
在 Visual Studio 中,使用 Nuget Package Manager 添加 Microsoft.Xbox.Live.SDK.WinRT.UWP
在您的项目中,在 Section 6 of these instructions 之后创建了一个 xboxservices.config 文件.
创建一个 TextBlock 控件来显示玩家代号。在我的例子中,我将它放在应用程序屏幕的左上角,并将其传递给以下函数以显示玩家代号:
public static async void InitializeXboxGamer(TextBlock gamerTagTextBlock)
{
try
{
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;
}
catch (Exception ex)
{
// TODO: log an error here
}
}
我在 MainPage() 构造函数的末尾调用了这个函数。
您必须在所有支持的平台(包括 Windows 10)上调用此函数才能获得商店批准。
然后,转到developer.windows.com,登录,选择你的游戏,选择“服务”,选择“Xbox Live”,点击“为你的测试环境授权Xbox Live账户”,这样你就可以在本地测试了.
此外,请务必单击“Xbox Live”部分中的“测试”按钮。
关于c# - UWP/C# 应用程序如何登录 XBox 用户并显示玩家代号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48257456/
我正在尝试使用 Eclipse 和 codename one 跨平台环境建立与数据库的在线连接。 很明显,将本地数据库放在默认文件夹中可以让您访问数据库,连接代码如下: db = Display.ge
我正在尝试通过代码在我的应用程序上打开侧面菜单。 我的表单使用工具栏用更复杂的组件填充侧面菜单。 我用它来关闭菜单: SideMenuBar.closeCurrentMenu(); 但我找不到等效的打
我正在使用 Codename One 开发移动应用。 我有一个外部容器,我通过调用方法 addPointerReleasedListener 添加了一个 ActionListener。 还有更多未添加
现在我正在使用 Codename one Calendar API,它工作正常,但我在日历 ui 方面遇到了一些设计问题。我的要求是当我点击特定的一天并将其添加为事件日时,那么该日的颜色就会改变。 以
我正在 Samsung Galaxy Tab A 10.1 (2019) 上测试我的应用(调试版本)。设备分辨率为 1200 x 1920。但是,当我使用 getDisplayWidth() 和 ge
我正在用 Textfield 创建一个 GenericListCellRenderer,我需要编辑 textfield 并替换其中的值,但我没有单击 Textfield 时获得任何焦点。我试过的代码如
Codename One动画发生了什么?我使用了很多,自12月起,我的应用程序不再起作用。当我在六月离开东西时,一切都很好(至今已经一年多了)。 我的应用程序是草稿(跳棋)游戏,自2013年以来在应用
我正在尝试为 Android 发布我的 Codename One-built 应用程序,但在尝试上传新版本(发布 apk 或 aab)时,我卡在了 Google Play 控制台上。 自 2021 年
我正在尝试在 Codename One 中使用计时器,但它只有“UITimer”,我似乎无法弄清楚也找不到任何示例。 所以我尝试了 Swing 计时器,但它给了我错误: codename1.ui.ev
我的应用程序构建正常,但是当我添加库 parse4cn1 时,构建失败 ios 失败示例: CompileC build/Main.build/Release-iphoneos/Main.build/
在代号一中,我试图实现一张用户卡,其中包含一些描述和两个操作按钮(调用和短信),位于卡的底部,彼此水平放置。有没有办法“分割”最后一个文本行?帮助会很棒! 谢谢! 最佳答案 您可以将这 2 个按钮放置
我目前正在用代号一写一个简单的游戏,我希望用户选择国家。 我希望在可滚动列表中将国家表示为图像。 我有一个在 X 轴上带有 BoxLayout 的容器,以及内部带有图标的按钮。 问题是不适合容器的列表
我正在尝试使用 setBrowserNavigationCallback BrowserComponent 的方法从 html 页面调用 java 方法。 这就是我在java中的内容:
我尝试将我的 Codename One 应用程序发送到构建服务器来构建 Android 应用程序,但它一直失败。一切在模拟器上运行良好,没有错误。唯一的问题是当我尝试将项目发送到构建服务器时。这是错误
我正在尝试以代号一创建一个音乐播放应用程序,在向媒体播放器添加 slider 时遇到问题。应用程序运行时会显示 slider ,但播放文件时不会显示进度。这是我用来添加自定义播放和暂停按钮以及 sli
我习惯用 Java 开发桌面应用程序。现在我正在尝试使用 Codename One 开发我的第一个移动应用程序。 在尝试复制我在 SQL 数据库方面的经验时,我遇到了一种非常奇怪的存储行为,我无法解释
我正在尝试使用我的 cn1 android 应用程序获取推送通知。我让它在 ios 上完美运行,但出于某种原因,它甚至没有在 android 上注册。这是我做的 我在我的 Play 商店控制台中启动了
我在 iPhone 7 上运行了一个代号为 one 的程序。那部手机最近没电了,我得到了 iPhone11 pro。我从旧手机中删除了 UDID,并将新手机的 UDID 添加到我的苹果开发者帐户中。我
我有一个图标按钮,带有一个小方形图标。 按钮嵌入在 BoxLayout 中。 有没有办法减小按钮的大小,以便自动达到图标的准确大小? 我的意思是,我知道我可以更改按钮的大小编辑边距和填充,但我想问我是
我正在创建一个媒体播放器应用程序,该应用程序应该从远程 URL 流式传输 mp3 文件。问题是,在代号为一个模拟器上一切正常,但在实际的 Android 设备上却不行。我希望该应用程序能够像模拟器上一
我是一名优秀的程序员,十分优秀!