samedi 28 mars 2015

The remote procedure call failed

This is my first post, so please be easy on me :)


I am doing a tutorial for Facebook SDK, and I am trying to login to the service. It works fine when I follow the steps of the tutorial, and hit the login button to log in, but when I am trying to automate this, I get an error.


The code uses WebAuthenticationBroker, calling WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl);


When I try to put that code inside Loaded event



private void Page_Loaded(object sender, RoutedEventArgs e)
{
if (this.fbHelper.AccessToken == null)
{
WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl);
}
else
{
GetUserInfo();
}
}


I get the following error:



The remote procedure call failed. (Exception from HRESULT: 0x800706BE)



I think the problem is that the page is not ready yet to perform the logic, but I don't really know where should I put the code?


Aucun commentaire:

Enregistrer un commentaire