Search code examples
iosfacebookipadfacebook-apps

Application has not configured its Mobile Web URL or the URL facebook error on iPad


I currently have a Facebook application running. Using Mobile Detect through PHP will redirect any mobile or tablet device to the direct link of the application instead of the Page Tab application.

if ($detect->isMobile() || $detect->isTablet()) {
    header("Location: https://[domain].com/facebook/[app]/");
} else{ 
   header("Location: https://www.facebook.com/[page-app]");
}

It's working fine on all devices except on the iPad. Through the iPad I'm getting this error:

Either this application has not configured its Mobile Web URL or the URL could not be verified as owned by the application. Unable to redirect.

On the app settings I have App on Facebook and Page Tab platforms set. No Website platform has been added. I thought adding this would solve this issue but after providing the URLs the same error started to come up on mobile devices as well.

I'm not sure if anyone has ever had this problem.

Update

This is happening on iOS and only on the Facebook app. Testing it on an iPhone or iPad browser works with no problems at all.

Update 2

So this is happening on the iOS Facebook in-app browser, what I'm trying to find out now is if there's some way to force Facebook to open links on to a browser rather than the in-app browser.

Similar questions:


Solution

  • I solved this issue by removing the redirect_uri when calling getLoginUrl. The app will redirect users through jQuery and calling Mobile Detect. If a user is not using the app from a mobile or tablet device, the user is redirected to the Facebook Page app.

    jQuery:

    function get_mobiledetect() {
        jQuery.ajax({
            url: "[URL]/get_mobiledetect.php",
            type: "post",
            success: function(data) {
                var mobile_detect = JSON.parse(data);
                if (!mobile_detect.isMobile && !mobile_detect.isTablet) {
                    if (top === self) {
                         window.location.href = [Facebook Page app URL];
                    }
                }
            },
            error: function() {
                 /* handle error */
            }
         })
     }
    

    Mobile Detect:

    include 'libs/Mobile_Detect.php';
    
    $detect = new Mobile_Detect();
    
    echo json_encode(array(
            "isMobile" => $detect->isMobile(),
            "isTablet" => $detect->isTablet()
        )
    );