问题
I've been reading alot (and searching alot) but can not find a decent resource for getting started with Facebook C# SDK for WP7. I'm NOT looking for a handout of code but rather a starting point to using this library to develop my WP7 app.
I'm aiming to provide a feature to authenticate a user and allow them to post to facebook.
I've read their documentation and there isn't anything on the topic, just how to register your app with facebook (???). They have 2 links to getting started but they bring up an empty page. Also most examples I have run into are targeting .NET 4(for desktop) or ASP.NET which do not use the same model as WP7(silverlight).
I've looked at the classes and methods provided, and they look easy to implement but apparently there are prelimenary steps needed (what are these?).
I know we would probably have to set up a new instance of the facebook app, and then authenticate but so far I have not been very successful in figuring this out.
Could someone please share some resources on where to get started with this? Thanks.
回答1:
There is a Windows Phone 7 specific sample in the Facebook C# SDK library:
Samples/CSWinPhone7SimpleApp.sln
It shows how to authentificate a user.
回答2:
Sample code is no longer available in the SDK itself. Head over to the blog to read up on creating your first app.
Writing your first Facebook Application
This is written for all platforms but it does mention any specifics you need to know for Phone 7 as well.
回答3:
When I looked last month, they didn't exist. You already found the desktop library that someone at Facebook put a little tiny bit of effort into. It's not a lot of code and you can use it as a reference. The only thing that stops it compiling for WP7 is some code dealing with string encoding. You can work around this fairly easily.
来源:https://stackoverflow.com/questions/5382473/how-to-get-started-with-the-facebook-c-sharp-sdk-for-wp7