Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook requests 2.0 , how to change "Accept" button url to be a url outside of facebook?

My app sits outside facebook canvas. The facebook request dialog 2.0 only redirects to canvas url eg. apps.ibibo.com/YOURAPP. How can I make it open a custom url ? This was possible in legacy FBML form with fb:request-form and setting req-url .

Are requests 2.0 restricted only to inside facebook URLS ? My requirement is to send game requests,but my game sits outside facebook. i.e. on clicking "ACCEPT" the url to open should be

"http://www.mydomain.com/mygame" and not

"http://apps.facebook.com/mygame" .

enter image description here

These methods do not seem to fit my requirement : http://developers.facebook.com/docs/reference/dialogs/requests/ ( only canvas url redirection )

I thought of one workaround as : The user clicks on "ACCEPT" and comes to the canvas url, and from the canvas url, I redirect him to my url outside facebook. But I am not sure if that is compliant with facebook policy ? ( mentioned here in point#4 of first paragraph : http://developers.facebook.com/blog/ )

like image 271
DhruvPathak Avatar asked Oct 25 '11 07:10

DhruvPathak


People also ask

How do I change my callback URL on Facebook app?

In the "Facebook Login" tab under your app, enter all valid callback URL's, such as http://localhost/callback, http://productionUrl/callback, etc. If you don't see "Facebook Login" tab under your app, click "Add Product-> Facebook Login->Get Started" Enter the Valid Callback Urls -> Save changes.

Can you change a Facebook page URL?

1 | Log into Facebook as the personal profile that's an Admin of the Page you wish to change on a computer. 2 | Go to your Page and click Edit Page info near the bottom left side (see image above). 3 | Click into your Username area. 4 | Enter a new username.

Where is the Facebook URL located?

You can find a Facebook URL in the address bar at the top of the browser if you are using a computer. To find the URL for a personal page in the mobile app, tap the three-dot menu and find the address in the Profile link section.


1 Answers

Need a jquery script to override the default function of facebook. However this works only when the person goes to "http://apps.facebook.com/mygame" and click on 'add app'.

Simpler to just have a welcome page, users click on "PLAY" and it opens a new window into your page.

Read more: http://developers.facebook.com/blog/post/525/ - good luck coding!

Put <button id="fb-auth">Login</button> somewhere on mygame page and add this javascript code:

function updateButton(response) {
  //Log.info('Updating Button', response);
  var button = document.getElementById('fb-auth');

  if (response.status === 'connected') {
      //button.innerHTML = 'Logout';
      button.onclick = function() {
        FB.logout(function(response) {
          //Log.info('FB.logout callback', response);
        });
      };
    } else {
      //button.innerHTML = 'Login';
      button.onclick = function() {
        FB.login(function(response) {
          //Log.info('FB.login callback', response);
          if (response.status === 'connected') {
            //Log.info('User is logged in');
            window.open("http://xxxxxxxxxxxxxxxx/some.html");
          } else {
            //Log.info('User is logged out');
          }
        });
      };
    }
};

// run it once with the current status and also whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
like image 74
Alvin K. Avatar answered Oct 06 '22 00:10

Alvin K.