Problem with FB.ui apprequest dialog box

I am trying to send application invitations from an Iframe application. I open the dialog as follows.

function sendRequestToOneRecipient(user_id) { FB.ui({method: 'apprequests', message: 'message', to: user_id, display: 'popup' }, requestCallback(user_id)); } 

When the dialog box opens, I get a ton of error messages "Unsafe JavaScript attempt to access a frame with a URL from a frame with a URL." The send and cancel buttons just make the dialog empty, but they don’t close, and it doesn’t work.

I don’t know if this is connected or not, but when I load the JS SDK in Chrome, I get "I can not read the" cb "property from undefined", and Firefox says "b is undefined". I no longer have links to the old FeatureLoader.js.

0
source share
2 answers

Here is the code I use to send apprequest, and I never had a problem with Chrome or Firefox ...: s

They recently publish several examples: http://developers.facebook.com/docs/reference/dialogs/requests/

Hope that helps

 function send_apprequest(){ var post_options = { method: 'apprequests', display: 'iframe', message: "My message", data: "Any data your want to pass", title: "My Title", ref: "Not required but useful for Insights" }; FB.ui(post_options,function(response) { if (response && response.request_ids) { alert('\o/'); } } ); } 
0
source

I found a problem. There was a Javascript file included that contradicted Facebook Javascript. I'm not quite sure what is controversial, but it has been the JSON library since 2005. Fortunately, it is not used, so I just deleted it. This is the copyright information in the file.

 // VC-JSON /* PROJECT: JDM (Java Dynamic Machine) PROGRAMMER: PRIVATE LICENSE FILE: vc-json/vc-json.js PURPOSE: GO! SERIALIZER & DE-SERIALIZER... Includes functions for: -- JSON/GO! Serialization -- JSON/GO! DE-Serialization -- JSON/GO! Parsing */ var JSON = { version : "0.000a", org: 'http://www.JSON.org', copyright: '(c)2005 JSON.org', license: 'http://www.crockford.com/JSON/license.html' 
0
source

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


All Articles