I have a game running inside Facebook and I’m trying to hide the game window when a user clicks on their search bar, friends, notifications or messages. I’ve looked into Facebook’s Javascript API and they have this “hideFlashCallback” delegate you can set in FB.init(). However it doesn’t seem like the callback is being hit.
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $config->app_id; ?>',
channelUrl : '<?php echo $config->app_host; ?>/channel.html',
status : true,
xfbml : true,
frictionlessRequests : true,
hideFlashCallback : function(params) {
var state = params.state;
alert(state);
}
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<center>
<div id="unityPlayer">
<div class="missing">
<a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
<img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" />
</a>
</div>
</div>
</center>
</body>