Facebook-c#-sdk how to pass form parameters and request permissions on same controller action
I have a iframe canvas application using the facebook-c#-sdk version 5.0.3. I'm using html.FacebookSignedRequest() [which works and puts the hidden field with the long encrypted value] call in my form but the user has not accepted permissions yet (we are letting the user browser our app and ask permissions when needed).
What happens is we use the [CanvasAuthorize] to request for the permissions we want. That part works, the user is redirected to the FB permissions request where they can accept or declined them. If they accept they are sent back to our controller method but the only parameter passed is signed_request, all other parameters are lost.
The form is posting to /controller/action but I have tried also apps.facebook.com/controller/action
[CanvasAuthorize(Permissions = "email,user_about_me,publish_stream,
offline_access")]
public ActionResult SomeMethod(string param1, string param2)
When I do this, the user will get the permissions page, but on return to my method the arguments are null.
Any ideas on how to pass data to a controller method while checking if the user has the permissions to do so?
I have read several posts on this, some saying that Html.FacebookSignedRequest() will do it, but not i开发者_Go百科n my case. Others say to go about this custom state deal that seems to be way to out there for something that should be simple and probably already part of the SDK.
Please help
Edit - I found the same issue here from Mr. Totten but for some reason this did not work, even when i upgrade to 5.2.1.
you should look at solution here: http://facebooksdk.codeplex.com/discussions/244819?ProjectName=facebooksdk
-Imran
精彩评论