开发者

How to use CanvasAuthorizer

I download the latest version and successfully tested the Mvc3Web sample. I tried to extend it to get email and friends but the CanvasAuthorizer is failing. The code below开发者_如何学Python is not working: CanvasAuthorizer _authorizer = new CanvasAuthorizer {Permissions = {"publish_stream,offline_access"};

throwing an exception complaining about appId being empty. Any idea how to acheive this? It's pitty that the samples are missing the permissions request functionalities.


change the code to use permissions as array.

CanvasAuthorizer _authorizer = new CanvasAuthorizer {Permissions = new[] {"publish_stream", "offline_access"}};

Update: Also make sure to have proper app settings in web.config for the application. or set it programatically (during application_beginrequest)

FacebookApplication.SetApplication(new DefaultFacebookApplication{ AppId = "...", AppSecret = "..." });
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜