Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LiveLoginResult.Status is Unknown?

I am trying the code to find out whether the user has already signed in or not?

LiveAuthClient LCAuth = new LiveAuthClient();

LiveLoginResult LCLoginResult = await LCAuth.InitializeAsync();

Even if the user has already logged in, it returns Unknown.

What is the problem with this?

like image 420
Kasun Wanniarachchi Avatar asked Feb 13 '13 11:02

Kasun Wanniarachchi


1 Answers

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
}

I had tried this snippet and it worked for me. Cheers

like image 86
Kasun Wanniarachchi Avatar answered Oct 25 '22 18:10

Kasun Wanniarachchi