yulun
yulun

Reputation: 260

Checking if user doesn't allow Canvas App in Facebook C# MVC

I am trying to track the number of users who did not allow my app during authorisation using the Facebook C# SDK and ASP.NET MVC.

By specifying the CanvasAuthorize attribute on my landing page, user will get redirected to a url like this:

canvasurl/facebookredirect.axd?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request.&state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL25pdmVhdGVzdGVydCJ9

My question here is..how do i code my app in such a way that i can read the querystrings and track the number of times my app has been denied access?

Upvotes: 2

Views: 390

Answers (1)

Joey Schluchter
Joey Schluchter

Reputation: 2612

By using the CanvasAuthorize attrib on your action there is also a parameter for CancelUrlPath, like so:

[CanvasAuthorize(Permissions="user_likes,email", CancelUrlPath="YOUR_PATH_HERE")]

This will allow you to set the path to an action that you can do all the tracking you like.

Hope this answers your question.

-Joey

Upvotes: 1

Related Questions