开发者

.NET facebook sdk silverlight

im trying to develop a silverlight application that uses facebook sdk, after some research i found an example here (source code and samples). i studied the CSSilverlightInBrowser project and i understand how it works a little, but when i try to run the project i get this error in the facebook window "An error occurred with ----. Please try again later". I already replaced the application id and the app secret in the application. i would really appreciate any help, thanks.

edit : after a couple of tries i figured out that when i call FacebookOAuthClient.GetLoginUrl(...) if i give null instead of this redirect url @"http://localhost:18201/slfbinbrowserlogin.aspx" i ge开发者_运维百科t a blank page that says "Success", so i believe this where it goes wrong(redirect url), (i thaught maybe facebook would'nt find the redirect url i gave since it's on my local machine so i tried google.com and it still did not work) please any help is appreciated, thanks in advance.


I received this problem numerous times trying to get the SDK to work, and then a few issues porting a working sample into my own project. Things that caused this included:

this parameter must be included when loading your .xap

- <param name='enableHtmlAccess' value='true' />

make sure you also include a reference to the javascript method your SL will call

- <param name="onLoad" value="slLoaded" />

also ensure you have the div id="silverlightFacebook" set (or whatever name the SDK javascript calls)

make sure "Site URL" is set in the web section on facebook development app console - https://developers.facebook.com/apps

make sure the excellent caching browsers seem to do with silverlight isn't tripping you up.. you might be loading an old version ;)

if you are using anonymous methods you might be getting an internal JSON error in the library which is being handled siliently. see http://facebooksdk.codeplex.com/discussions/265941 I had to add the following to assemblyinfo.cs [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Facebook")]

At the time of writing, the 'stable' version (5.0.50.0) of the facebook SDK on codeplex has some bugs which prevent posting from working, however I can successfully post by downloading the latest changeset and building the source with my project. the sdk source code builds nicely and is organized well so easy to attach to your own project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜