1

I am developing a demo app on Windows Phone 8 using the Microsoft Live Connect Api to access the sky drive.

Below is my code :

In Xaml :

<live:SignInButton Name="skyBtn" ClientId="MY_Client_Id" Scopes="wl.basic" Branding="Skydrive"  TextType="Login" Margin="109,403,153,131" SessionChanged="skyBtn_SessionChanged"/>

I have used built in button to sign in.

In xaml.cs :

private void skyBtn_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
    if (e.Status == LiveConnectSessionStatus.Connected)
    {
      session = e.Session;
      client = new LiveConnectClient(session);
      tbMessage.Content = "Connected!";
    }
}

Basically my problem is on
if (e.Status == LiveConnectSessionStatus.Connected) line

Status always come unknown

I have searched a lot but I'm not able to solve this.

svick
  • 236,525
  • 50
  • 385
  • 514
Pravesh Singh
  • 314
  • 1
  • 8
  • 27

1 Answers1

0

Make sure you declare internet access for your application.

<Capabilities>
  <Capability Name="ID_CAP_NETWORKING" />
  <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>
Andras Csehi
  • 4,305
  • 1
  • 28
  • 36
  • as well? It is needed to show the login screen. – Andras Csehi Dec 14 '13 at 15:31
  • this option is also already checked, there is something else wrong with this code – Pravesh Singh Dec 14 '13 at 15:35
  • I can't see anything wrong with the code. Use e.Error to get the error message. http://msdn.microsoft.com/en-us/library/live/microsoft.live.controls.liveconnectsessionchangedeventargs.error.aspx – Andras Csehi Dec 14 '13 at 15:46
  • in e.Error This message comes --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.Live.LiveAuthClient.d__c.MoveNext() – Pravesh Singh Dec 14 '13 at 15:52