Mobile users unable to access Facebook page tab
Asked Answered
L

6

22

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!

Larentia answered 6/4, 2013 at 21:50 Comment(0)
H
58

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.

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.

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:

(Edited to reflect updated Dev Settings UI and readibility)

Heartbreak answered 6/4, 2013 at 21:50 Comment(12)
This doesn't work - I still get a "The page you requested was not found" message from Facebook, embedded in a "4oh4"Homework
Is the app in sandbox mode? If it is, you'll need to be logged into facebook in your mobile web browser otherwise you'll get a 404.Heartbreak
The app is in full production mode, and is actively being served to non-mobile Facebook users as we speak.Homework
You must have a config mismatch, because I have several apps running in this way at the moment.Heartbreak
My Mobile web URL is exactly the same text as what I have for Page Tab URL; Canvas URL is the only one that is different so that it can serve up the redirect.Homework
What would be the point of reposting your answer? "This answer that someone posted as a hack to address an unsupported Facebook issue doesn't seem to work, why not?"Homework
There are two possibilities - there is a facebook bug that specifically affects your app, or you have made a configuration mistake. If you don't post your code it's impossible to know which has occurred, but I'm guessing the second is more likely. :)Heartbreak
@Heartbreak posting on a dated thread I know. But say for example I need to determine whether a user likes a particular page or not within my app, how do I go about doing that? I tried getting the 'user_likes' permission approved but Facebook rejected it as not being constructive. So the only way I can check if the user likes my page is by page tabs but then I cant' support mobiles! Any solutions?Prinz
This method will now fail with Facebook's review system. Looking for a workaround which I'll add if I can a reliable system.Tittivate
Currently not possible on the platform see open bug report below, without submitting a request for them to manually allow it per app. developers.facebook.com/bugs/1051463851558493 for more informationStrapper
Can anyone tell me if this workaround still works? Simple messing around makes it seem like Facebook has disallowed any redirect in iFrames due to "abuse by spammers" Also, when this is finished, the actual TAB still won't appear on mobile, will it? Only the FB official tabs show, no custom ones, right?Seve
Sounds like the link Joel posted renders this useless... Is there any way to get mobile users to view your app, via redirect or anything with any semblance of good UX?Seve
B
3

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.

Bioplasm answered 21/5, 2014 at 18:24 Comment(2)
What configuration settings allow automatic redirection to mobile site?Willaims
You should just have to add your site information in your app settings on facebook.Bioplasm
S
1

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.

Saidel answered 10/10, 2013 at 14:9 Comment(0)
S
0

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

Swarts answered 10/7, 2013 at 10:13 Comment(1)
This doesn't seem to work when following the link from the Facebook Android app, I only get a never-ending loading screen. But it does work when using the mobile FB website in a browser.Vite
M
0

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.

Mainsail answered 6/9, 2013 at 18:48 Comment(0)
I
0

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();
}
Interest answered 21/2, 2017 at 17:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.