Why cannot others see my app/use my app - facebook

I have created a facebook canvas app. It embeds a web site (which is fully functioning for several months).
If I paste the app url in browser, only I can see the app. But when any of my friends type https://apps.facebook.com/XXXXXXXXXXXXXXXXXXXX, they are not able to/allowed to see the page. Even when they are logged in as facebook user, they are not allowed to see the app page.
(I have implemented facebook login using javascript in my home page)
Can anyone give any hints.

Go to "Settings & Review" in the App Settings, there is a checkbox to put the App live. Else, only users with a role in the App can use it.

Related

Facebook logout when not authorized

I'm building a public installation using an iPad, built as an iOS web app (using the "Add to Home Screen" functionality) which is going to allow users to share content on Facebook.
I'm currently logging the user in to Facebook and getting them to authorize my Facebook app when they click my custom share button. On a successful login, I open Facebook's Feed dialog and allow them to share. Once they have shared (or clicked cancel) I automatically log them out, making sure that the next user that uses the public installation won't be able to share to the previous user's Facebook account.
This all works well, but things get tricky if someone was to hit my custom share button, log in to Facebook and then not allow my app. This would mean that they have logged in, but as they haven't authorized the app, I don't have an access token, and so can't log them out (FB.logout() requires an access token).
Is there a way around this?
Or is there another way that I can log a user out?
Or is there a safe way to allow a user of a public installation (built in HTML) to share on Facebook and be automatically logged out afterwards? Would building a native obj-c app, and using Facebook's iOS SDK help?
The best I can think of is that if the user logs in but doesn't allow the application, they are told that they need to log out, and redirected to Facebook to be able to do this. However this offers them the chance to browse Facebook and (through shared links in their feed) the whole Internet - this isn't acceptable for our installation.
I solved this problem by creating a native iOS app, where the Facebook share link opened in it's own UIWebView. And once the sharing was complete, I deleted all session & cookie information, effectively logging the user out.

Mobile users unable to access Facebook page tab

I'm having a problem that I can't see to fund the solution to.
I have a tab on my Facebook page (one of those static HTML: iFrame apps). There are no problems accessing it from a PC, however when I try accessing the tab from a mobile device it says:
"The page you requested was not found.
Back to previous page"
Is there some way I can either create a tab accessible on mobile devices, or just redirect them to an external domain?
Thanks!
How to create a mobile accessible Facebook Page Tab App
In order to create a Page Tab App which has a mobile accessible version (an external website accessed directly, not via a Facebook iFrame). You need to add and configure 3 different "Platforms" in the app developer settings. These should be configured as follows:
Page Tab
Configure this as you would normally.
Page Tab Name: the name you want to appear on the page tab
Page Tab Url: the url where you are hosting the page tab app (e.g. http://myapp.com/page-tab)
Secure Page Tab Url: the same thing but with https in front (e.g. https://myapp.com/page-tab)
Website
This is where you configure the url for your mobile site
Mobile Site URL: This is the url you want mobile users to be redirected to (e.g. http://myapp.com/mobile-version)
Site URL: This is used for Facebook Connect, if you are not using Facebook connect, just put your mobile url in here too.
App on Facebook
This is going to be the gateway to your app. Mobile users arriving on this page will be redirected to the mobile website. You can use javascript to redirect desktop users to your Facebook Page Tab App.
Canvas App Page: this will be http://apps.facebook.com/my-app-namespace, this is the link you will post on your facebook wall or in your ads, or anywhere else you want to link to your page tab
Canvas Url: this is a link to a page on your app that will be embedded as an iframe on the canvas app page. You will use this page to redirect to your page tab using JavaScript. e.g. http://myapp.com/canvas-redirect
Secure Canvas Url: This is the same as above but with https in front (e.g. "https://myapp.com/canvas-redirect")
Your Canvas Redirect Script
You want people arriving at your canvas app on a desktop browser to be redirected to your page tab app. Because it is loaded inside an i-frame, the only way to do this is using JavaScript.
This will be the content of your Canvas Url (http://myapp.com/canvas-redirect above):
<script>top.location="http://facebook.com/page_tab_url/app_1234"</script>
Note the "top.location" - this will redirect the parent window, not just the iframe to the page tab. When a user arrives on the canvas page in a desktop browser, they will be redirected via JavaScript to your Page Tab App. Mobile users will be redirected by Facebook to the Mobile Site Url you specified above.
Testing in Sandbox Mode
If your app is in Sandbox Mode, only admins, developers or testers of the app will be able to see it. In particular users not logged into Facebook, or who are logged into Facebook but are not admins or testers of the app, will not be able to access the app canvas page - they will just see a 404 error. In order to test your mobile redirect when the app is in sandbox mode, you need to ensure that you are an an admin, developer or tester of the app AND you are logged into Facebook's mobile site on your phone's web browser - i.e. Safari on iOS and Chrome on Android. It is not sufficient to be signed into the Facebook Mobile App on your phone, you must also be logged in using the browser.
A note about User Roles
You can configure the App User Roles by clicking on the "roles" tab in the app settings. You can add a Facebook user, or a Facebook Group as any of the roles. (If you add a Group, all the users in that group will have the role specified in the app). In order for a user to have a specific role on an app, they must:
Verify their facebook account: http://www.facebook.com/help/verify
Install the Facebook Developer app https://developers.facebook.com/
(Edited to reflect updated Dev Settings UI and readibility)
As an update to this, Facebook now automatically redirects to your website without needing any hacks.
To do this make sure you have added a website platform to your app and put your mobile URL in there.
I had a hard time figuring out how to access page tabs with mobile and, thanks to Ben in a previous comment, I found a way. First of all, you can't access page tabs with your mobile phone, so you will need to point it where your page tab takes it source. Facebook can do that for you if you are using canvas, but if you access it with a desktop computer, you will be redirected to your canvas link, not your page tab. This is how we fix it :
--
1) Go into your App (Facebook developers) under Settings - Basic
2) Copy your Page Tab URL from the Page Tab section (something like http://yourpagetab.yourdomain.com), and past it in your Mobile Site URL into the Mobile Web section.
3) Do the same with the App on Facebook section, but instead of pointing it into your page tab, you will have to use a redirection file. Let's use http://yourpagetab.yourdomain.com/redirection.php?fb
Note that you have to use ?fb at the end of your link. It does nothing, but Facebook wants it. Actually it could be ?anything and probably only ?
4) Create that redirection.php file (don't add the ?fb) and add this code in it
<script>top.location="http://facebook.com/your_fb_page/your_page_tab"</script>
You have tho replace /your_fb_page/your_page_tab with the link to your page tab.
5) Save it!
--
Now, all you have to do is to use the Canvas Page url that Facebook provides you (under App on Facebook). If people click on it and are on desktop, they will be redirected into the page tab. If they are on mobile, they will be redirected to your website hosting the page tab.
If you are using fan gate (user have to like your page before accessing your page tab) : this will not work as the mobile user will get stuck on your fan gate.
The only ways to get through that is to disable the fan gate or to use Mobile Detect (you can search it on Github) and disable it only for users that are on mobile. It's a small price to pay if you want your page tab to work with mobile users. Desktop users will still need to like your page to see your page tab.
you can also use a link like this to stop facebook redirecting mobiles
https://www.facebook.com/MyAppName/?sk=app_11111-APP-ID-11111&ref=ts
I'm one of the developers of Static HTML. We actually have a feature built into the app now that generates smart, shortened links that work for mobile and desktop. If you click on the "+" icon at the top of the editor, it'll pull up a shareable link.
If you use that link, we do a little bit of extra magic so that your tabs fit better on small screens.
Edit: we've discarded the special formatting, because it was glitchy on iOS devices.
Here is the php code I use for the redirect:
// Mobile_Detect
require 'Mobile_Detect.php';
$detect = new Mobile_Detect;
if (strpos('https://' . $_SERVER['HTTP_REFERER'] . $_SERVER['REQUEST_URI'], 'facebook.com') !== false && $detect->isMobile()) {
echo '<html><head><script type="text/javascript">window.top.location.href = "https://yourappurl.com";</script></head><body></body></html>';
die();
}

Tab App (FB) wont show on Facebook iPhone App

I created a facebook and placed it on my facebook brand page, I also created a post on the wall of that page with the link to the app.
all works well until people started calling me saying that when accessing using FB iPhone app it will redirect to an error page "the page your requested was not found"
I tried adding a link (same page) to the "Mobile Web" link of my app in the FB Developer App.
it still doesn't work..
I need people accessing the app page to get some content.. I know it is possible but cant find how..
thanks for your help
Tabs aren't supported via the app or mobile site. Best you could do is add the query parameter "ref=ts" to prevent the page from going switching to mobile. It helps in the browser but not the app itself.
So add ?ref=ts to the end of your app url and at least mobile users can see it in their browser.
http://facebook.stackoverflow.com/a/10833366/461119

Facebook search for app redirect

I recently build an iframe app for within Facebook, and for facebook only. So no need to call the iframe outside of Facebook. The only problem i have now, is that as soon as i search for the app like this:
http://i44.tinypic.com/30rla83.png
I get the following warning: http://i43.tinypic.com/2uh1w20.png
I can't seem to find out how to configure the app so it won't redirect, but goes directly to the app itself. The only values set are the 'Website' and 'Page Tab' value. When i set a value for the 'App on Facebook', the iframe gets included in the game/app format (with Facebook games in the right bar) by Facebook, and not the Facebook page app content format.
And when i delete or adjust the 'Website' value and i use Facebook search, i get the error that the app is not configured correctly. It's now set to the full addresss outside of Facebook, because when i configure it to the Facebook App URL i get the same error.
The only value i'm sure of is the 'Page Tab' value.
Thanks in advance guys, i can't seem to find the answer myself..
UPDATE: it turns out the 'you are being redirected'-page only occurs with my Facebook profile! Probably because I'm the Facebook Page admin or the app creator? Anyway, as far as I'm concerned; case closed and problem solved :)
It's slightly confusing which options apply to what types of app on Facebook - and the behaviour of the search is slightly unintuitive but here are some pointers that might help you:
If your app is going to only exist as a page tab, it doesn't really make sense to search for it (it could theoretically exist on multiple facebook pages). These won't show up in search results unless you have also set one of the following two options as well
If you have set up your app as a canvas app, "app on facebook" in the developer settings then when you search for the App, it will redirect you to the canvas page (your iframe being pulled into a Facebook canvas.
if you have set your app up to work with Facebook Connect "Log in to my website using Facebook." in the developer settings, and you haven't also set up your app to operate as a canvas app, then Facebook will assume that you have a web app that is external to Facebook, and searches will redirect the user to your website url.
So, what you probably need to do is either remove your website url from your facebook settings if you aren't using Facebook Connect (in which case your app won't show up in Search results) or create a canvas page as well, which redirects you to the correct facebook page tab.

App profile page versus m.facebook.com

Can this be true, or am I missing something, big time? It seems there's no way to access a Facebook app's profile page on the Facebook mobile site (m.facebook.com)?
I thought I wouldn't need to create a separate fan page for my app now that the app's profile page kind of looks and feels like a regular fan page. But if it's not accessible in Facebook mobile, then it's no use to me whatsoever - the thing is, I'm developing a native iPhone app, and the Facebook app is just for sharing the results, promoting and building fanbase - in other words I need a "Visit app's Facebook page" button in my iPhone app, and obviously the link should open in m.facebook.com, not the full www.facebook.com site.
I have no problem opening regular fan pages in Facebook mobile on my iPhone, or opening app's profile pages in the regular Facebook site. But I can't seem to be able to access any app's profile page in Facebook mobile. Please tell me I'm just dumb and there's of course a way to do this.
Here's a few ways that I was able to make it work.
Named pages
m.facebook.com/coke
m.facebook.com/facebook
m.facebook.com/yupiq
Applications
m.facebook.com/profile.php?id=150980384961454
Does that solve it for you?
EDIT:
I was unable to get the m.facebook.com/{id} to work for anything.