Forum Sitebox Callbacks not triggering for FB requests

Discussion and help relating to the PlayerIO webpage and Facebook app hosting solution, Sitebox.

Callbacks not triggering for FB requests

Postby mindbogglegames » January 17th, 2013, 1:24 pm

None of my callbacks trigger when I use facebook ui requests(callbacks for fetching friends etc work fine)

For example if I trigger the FB pay window with the "pay" requests. If pops up and everything works fine, but I don't get any callbacks if the user actually paid or cancelled the request. I have the same problem with all my FB requests, they pop up fine but callbacks in the client don't trigger.

Anyone had this problem before or know a solution?

I'm thinking there is something wrong with my javascript in the master file. I use this, it's mostly just copied from the examples from playerIO and some stuff cut away

It looks like this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
{% require_session %}
<link rel="stylesheet" href="{% url 'style.css' %}" />
<script type="text/javascript" language="javascript">
// this array will contain a list of functions that will be
// called when facebook is fully loaded and user is logged in.
var onFacebookAvailable = []

// will execute all queued up methods.
function runOnFacebookAvailable() {
for (var i = 0; i != onFacebookAvailable.length; i++) {
var cb = onFacebookAvailable[i];
cb();
}
}
</script>
<script type="text/javascript">
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript" src="{% url 'nutsforlovejs.js' %}"></script>
</head>
<body>




<div id="content">
{% block content %}{% end %}
</div>



<div id="fb-root"></div>
<script type="text/javascript" language="javascript">
window.fbAsyncInit = function() {
FB.init({
appId: '{{fb_application_id}}',
frictionlessRequests : true,
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});

FB.getLoginStatus(function(response) {
if (response.session) {
runOnFacebookAvailable()
} else {
FB.Event.subscribe('auth.login', runOnFacebookAvailable);
}
});

FB.Canvas.setAutoResize();
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
} ());
</script>

</body>
</html>
mindbogglegames
Paid Member
 
Posts: 38
Joined: December 19th, 2011, 6:51 pm

Re: Callbacks not triggering for FB requests

Postby mindbogglegames » January 17th, 2013, 2:52 pm

I'm getting these errors if I check the error console in Firefox

When opening the FB app page
Timestamp: 2013-01-17 14:48:40
Error: TypeError: swf is null
Source File: "omitted"
Line: 80

And I get this error if I open up a FB ui window and press accept or cancel
Error: TypeError: FBAS.getSwf(...) is null
Source File: "omitted"
Line: 51

"omitted" is replaced by me
mindbogglegames
Paid Member
 
Posts: 38
Joined: December 19th, 2011, 6:51 pm

Re: Callbacks not triggering for FB requests

Postby mindbogglegames » January 17th, 2013, 6:17 pm

I was using the adobe facebook graph API this was causing the issue. Thought I had thoroughly tested both player.IO and Facebook graph API before and that they both failed with the callback, oh well. The Player.IO Facebook classes work. Avoid the Adobe one like the plague ;)
mindbogglegames
Paid Member
 
Posts: 38
Joined: December 19th, 2011, 6:51 pm

Re: Callbacks not triggering for FB requests

Postby Benjaminsen » January 18th, 2013, 8:27 pm

mindbogglegames wrote:I was using the adobe facebook graph API this was causing the issue. Thought I had thoroughly tested both player.IO and Facebook graph API before and that they both failed with the callback, oh well. The Player.IO Facebook classes work. Avoid the Adobe one like the plague ;)


Tadaa!
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to Sitebox