LiveLoginResult.状态未知

本文关键字:未知 状态 LiveLoginResult | 更新日期: 2023-09-27 17:58:59

我正在尝试代码,以确定用户是否已经登录?

LiveAuthClient LCAuth = new LiveAuthClient();
LiveLoginResult LCLoginResult = await LCAuth.InitializeAsync();

即使用户已经登录,它也会返回Unknown。

这有什么问题?

LiveLoginResult.状态未知

LiveAuthClient authCilent = new LiveAuthClient();
LiveLoginResult loginResult;
loginResult = authCilent.InitializeAsync().Result;
if (loginResult.Status == LiveConnectSessionStatus.Connected)
{
   /* 
   Also use loginResult.Session as the Session which you will require to use live services by creating LiveConnectClient instance as follows.
   */
   // LiveConnectClient liveClient = new LiveConnectClient(loginResult.Session);
   // Write the logic you want by using liveClient instance
}

我试过这个片段,它对我很有用。干杯