Reputation: 123
I'm trying to publish to a user's feed, and I've got Login working using the facebook.net SDK. I've installed both the Facebook and Facebook.Client nuget packages.
This line of code isn't working for me:
var fbClient = new Facebook.FacebookClient(_loginButton.CurrentSession.AccessToken);
Specifically, .CurrentSession
does not exist as a property on the LoginButton class. Without it, I can't get the AccessToken
, and can't publish to a user's wall.
What's the right way to do this in Facebook.Client 0.9.91-alpha?
Upvotes: 0
Views: 173
Reputation: 123
After some trial and error, I believe I've found the answer. The AccessToken
is now accessible via Session.ActiveSession.CurrentAccessTokenData.AccessToken
, which means the line of code should be:
var token = Session.ActiveSession.CurrentAccessTokenData.AccessToken;
var fbClient = new Facebook.FacebookClient(token);
Upvotes: 1