Might be useful to have support for users who haven't added app

Jul 9, 2007 at 9:26 PM
Suggestion for a later version

In my facebook app, there are some pages that I want to be visible to users even if they haven't added my application.

It might be useful to have a bAllowNonAppViewer or something in the code sample (or binary/source files) that if it is set to true, will prevent the redirect to the add app page from occurring (this only really makes sense to me in a canvas page where you can be sure that the user is actually a facebook user just by virtue of the fact that facebook hasn't redirect them to the login page).

Even so you'd have to be sure before making any fbService method call (for example fbService.AreFriends(userID1, userID2) that fbService.UserID > 0 (if the user isn't an app user, Facebook doesn't give you the userID or a session key, so you can't call the api without it throwing an error in the facebook developer toolkit, but you know if they aren't an app user if the userID = 0, at least in my workaround)
Coordinator
Jul 9, 2007 at 10:13 PM
there is a property on the CanvasBasePages called AutoAdd which is meant for this purpose.

Jul 17, 2007 at 3:15 PM

rpowers119 wrote:
there is a property on the CanvasBasePages called AutoAdd which is meant for this purpose.


Hi,

When a user that does not have my application tries to access one of my CanvasIFrameBasePage(release 1.2 vb) it redirects them to the /tos.php? page instead of /add.php? page. is there a way to force it to redirect to /add.php? page?




Coordinator
Jul 18, 2007 at 2:47 PM
I don't think so. The process of adding an app is 2 parts. User's always need to agree to the TOS prior to viewing anything from an app. Beyond that, you can also require that they add the app to their profile if you want.

They should only need to agree to the TOS one time.
Jul 18, 2007 at 7:21 PM

rpowers119 wrote:
I don't think so. The process of adding an app is 2 parts. User's always need to agree to the TOS prior to viewing anything from an app. Beyond that, you can also require that they add the app to their profile if you want.

They should only need to agree to the TOS one time.

Hi,

Thanks for your reply, but in my experience when clicking on application content on other user's profile page from applications that I don't have installed, I am commonly redirected to www.facebook.com/add.php?api_key page to install the application. It does this without first displaying the TOS page. Just wondering if this can be replicated in the CanvaseIFrameBasePage authentication logic?

I had a look at the source code of CanvasIFrameBasePage.vb
----code:---------------------------------------------------------------
If (Not _fbService.IsAppAdded()) AndAlso _autoAdd Then
If Not _fbService.SessionKey Is Nothing Then
Response.Cookies.Clear()
Response.Write("<script type=""text/javascript"">" & Constants.vbLf & "if (parent != self) " & Constants.vbLf & "top.location.href = """ & FACEBOOK_ADD_URL & _fbService.ApplicationKey & "&v=1.0" & """;" & Constants.vbLf & "else self.location.href = """ & FACEBOOK_ADD_URL & _fbService.ApplicationKey & "&v=1.0" & """;" & Constants.vbLf & "</script>")
Response.End()
Else
Response.Write("<script type=""text/javascript"">" & Constants.vbLf & "if (parent != self) " & Constants.vbLf & "top.location.href = """ & FACEBOOK_LOGIN_URL & _fbService.ApplicationKey & "&v=1.0" & """;" & Constants.vbLf & "else self.location.href = """ & FACEBOOK_LOGIN_URL & _fbService.ApplicationKey & "&v=1.0" & """;" & Constants.vbLf & "</script>")
Response.End()
End If
End If
------end code------------------------

I can't see any reason why it doesn't go directly to the FACEBOOK_ADD_URL. The code above appears to do just that yet in facebook that's not what happens. If i type the FACEBOOK_ADD_URL into the browser it goes directly to the add app page. There must be a way to direct to the add application page. php users appear to use $facebook->redirect($facebook->get_add_url()); It's like facebook is handling the redirection differently on our end from that of php?... Sorry for the long winded post. Just trying to work through this. Hope someone can help with this.
Coordinator
Jul 18, 2007 at 9:28 PM
No problem.

I will check on this. The problem is that I think the first time, I am not successfully getting the requesting session, so when I send to login, it redirects straight to TOS.

I think the issue is that I need to see that the user is already logged in and not send to login page, since this is where the TOS comes from. I will play around with this and see if I can tell of anyway to know that the user is logged in.
Oct 16, 2007 at 9:14 PM
what is the status of this? I would also like to direct users to the add URL rather than the TOS first. It seams to me there should be a generic redirect method within the toolkit.