Question

I am running a iframe tab app. After sending invites from my app, I need the users to be directed to the actual iFrame tab location, NOT the location of the canvas app.

I heard that Facebook had an option for bookmark where you could enter a URL to direct users from the Canvas to the page tab, but this appears to have dissapeared.

Is there no way of doing this? Can I perhaps pass the value or return_uri when sending the invite?

Here is my code for sending the invites atm:

FB.ui({method: 'apprequests',
                        message: 'App message'
                    }, function(data) {
                        // jQuery functions:
                        $("#sendToFriends").fadeOut();
                        $("#didyouknow").fadeIn();
                    });

Any help will do!

Was it helpful?

Solution

It appears that Facebook may have removed the bookmark field, but I found the following script which effectively could help you redirect the user from the canvas page to a page of your choice (could be the actual location of the app within your page).

Put this code at the top of your application:

<?php
if(isset($_GET["request_ids"])) {
    ?>
    <script type="text/javascript">
        top.location.href = "INSERT URL HERE";
    </script>        
    <?php            
    exit;
}
?>

The script will then pickup if a request_id has been set via a get variable (this happens when a user clicks on a app request invite. If the variable is set, it will redirect the user using Javascript to any page you send them to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top