Hay there, I'm learning the live SDK fro windows phone 8 & I'm using Live SDK 5.5. I have downloaded the SDK, installed it and referenced it in my project I also have created a key for my application and I followed the exact code in here and that's my code: XAML
<live:SignInButton ClientId="my ID" x:Name="btnSignin" Scopes="wl.signin wl.basic" Branding="Skydrive" SessionChanged="btnSignin_SessionChanged" Margin="10,0,-10,194" Height="104" VerticalAlignment="Bottom" />
<TextBlock Height="102" Foreground="White" HorizontalAlignment="Left" Margin="26,128,0,0" Name="infoTextBlock" VerticalAlignment="Top" Width="419" />
</Grid>
and that's my C# code
private async void btnSignin_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
if (e.Status == LiveConnectSessionStatus.Connected)
{
client = new LiveConnectClient(e.Session);
LiveOperationResult operationResult = await client.GetAsync("me");
try
{
dynamic meResult = operationResult.Result;
if (meResult.first_name != null &&
meResult.last_name != null)
{
infoTextBlock.Text = "Hello " +
meResult.first_name + " " +
meResult.last_name + "!";
}
else
{
infoTextBlock.Text = "Hello, signed-in user!";
}
}
catch (LiveConnectException exception)
{
this.infoTextBlock.Text = "Error calling API: " +
exception.Message;
}
}
else
{
infoTextBlock.Text = "Not signed in.";
}
}
But the application doesn't show me the login page so that I enter my user name and password for my live account it just loads and then it says " not signed in" in the text box.
As it turned out after checking comments adding wl.skydrive
to Scopes property solved the issue:
<live:SignInButton ClientId="my ID" x:Name="btnSignin" Scopes="wl.signin wl.basic wl.skydrive"
Branding="Skydrive" SessionChanged="btnSignin_SessionChanged" Margin="10,0,-10,194"
Height="104" VerticalAlignment="Bottom"/>
More about available scopes you can read here at MSDN.
Also your App should me marked as for mobile devices at your account.