Can Facebook's request dialog work as a display: iframe or display: page?

The examples for all Facebook dialog boxes display a page for redirecting the user in the form http: //www.facebook.com/dialog/xxx? Yyy ... EXCEPT the Query Dialog, which shows examples using FB.UI () in the JavaScript SDK .

http://developers.facebook.com/docs/reference/dialogs/requests/

My question, which was not addressed anywhere in the Facebook documentation, is accessing the dislog request by directing the browser to http://www.facebook.com/dialog/apprequests ? ..

I try for hours, but I keep getting "Sorry, an error occurred." Am I doing this wrong or cannot be done?

+4
source share
6 answers

I can solve it

you need to use a url like

http://www.facebook.com/dialog/apprequests?app_id=APP_ID&redirect_uri=URL_GIVEN_IN_APP/&message=abc

It works great for me. Hope this helps.

+4
source

You cannot force the request dialog to behave like a page directly, but you can use XFBML and fb:request-form on the page, say, invite.php in your application to create a request invitation form.

http://developers.facebook.com/docs/reference/javascript/fb.xfbml.parse/ http://developers.facebook.com/docs/reference/fbml/serverFbml/

+1
source

I tried to debug this a lot.

The last code that seems to have worked once was

 <iframe src="https://www.facebook.com/dialog/apprequests?access_token=xxxx&api_key=xxxx&app_id=xxxx&display=iframe&frictionless=false&locale=en_US&message=abc&next=xxxx" frameborder="0"> 

I got this to work in one of the browsers, but when I try it in another browser, I consistently continue to receive the error below.

API error code: 110 API Error Description: Invalid user ID Error message: Missing user cookie (to validate session user)

What is the best way to set a user cookie? Facebook Connect Maybe? I will probably use this code somewhere in the Facebook application and check if it works. I think this is just a cookie problem. I also tried to provide user_id manually as well, but that didn't work.

This will definitely not work with IMO http, it should be https.

+1
source

http://developers.facebook.com/docs/reference/javascript/FB.ui/

You can specify a display option, as shown in the Options section.

 FB.ui({ method: 'apprequests', display: 'iframe', message: 'Your message', title: 'Your title' }, function(response) { alert(response.request_ids); }); 
0
source

I think you're right. If you combine the information from http://developers.facebook.com/docs/reference/dialogs/requests/ and http://developers.facebook.com/docs/reference/dialogs/ , your url should work ... Me too tried, but also get an error message ...

0
source

As Gohan Ozturk said, you can specify (display: 'iframe') for Apprequests.

To do this, you will need to provide an access token for the user:

 FB.ui({ method: 'apprequests', display: 'iframe', access_token: Users Access Token Here, title: 'Sample Title', message: 'Sample Message', data: 'some data here', filters: ['all'], }, function(response) { if (response && response.request_ids) { alert('Request was sent'); } else { alert('Request was not sent'); } }); 

You will also want FB.init () via the JSDK, but you can do this without using it to control access tokens and authentication,

 FB.init({ appId: 'Application Id', status: false, cookie: false, xfbml: false }); 

This worked for me when I use php for authentication, but still need access to the fb.ui functions from javascript sdk.

display: "iframe" - should work for all methods of the dialogue "friends", "feed", "send", etc.

0
source

Source: https://habr.com/ru/post/1342404/


All Articles