• Advertisement
Sign in to follow this  

[web] Facebook integration in silverlight

This topic is 2323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heyho,

I'm trying to implement facebook authentification to my silverlight application. I got everything set up on facebook and the application is already connected there.
While searching for some samples about how to manage that I didn't found any example which doesn't use an asp.net host application. Is there a way to actually manage this without having a windows server running...?

I found one example for Silverlight apps, but this one is only for Silverlight apps running out of browser, because of the Webbrowser-Control not working in-browser. ( http://blog.prabir.me/post/Facebook-CSharp-SDK-Writing-your-first-Facebook-Application.aspx ).

What I have so far is basically everything provided in that link, except the part where the browser comes in:


public string accesstoken;

public MainPage()
{
InitializeComponent();
LoginToFacebook();
}

void LoginToFacebook()
{
string appId = "app_id_here";
string[] extendedPermissions = new[] { "publish_stream", "offline_access" };

var oauth = new FacebookOAuthClient() { AppId = appId };
var parameters = new Dictionary<string, object>
{
{ "response_type", "code" },
{ "display", "popup" }
};

if (extendedPermissions != null && extendedPermissions.Length > 0)
{
var scope = new StringBuilder();
scope.Append(string.Join(",", extendedPermissions));
parameters["scope"] = scope.ToString();
}

var loginUrl = oauth.GetLoginUrl(parameters);
}

void oauth_GetApplicationAccessTokenCompleted(object sender, FacebookApiEventArgs e)
{
}


I hope you can help me :(

Sincerely,
xbaalx

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement