- Home /
Facebook WebPlayer hideFlashCallback
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>
Answer by David Wn · Apr 30, 2013 at 10:36 PM
So I added a dummy object right about my unityPlayer div and it seems to work now.
<object width="1" height="1" id="facebookFakeFlash" align="middle" type="application/x-shockwave-flash"></object>
Your answer
Follow this Question
Related Questions
Problem with UnityObject2.SendMessage | communicating with the web player 0 Answers
Can't replace loading image in web player 1 Answer
Stopping WebPlayer execution from javascript 0 Answers
configure/inject backgorund in facebook canvas 0 Answers
Hiding/Resizing the Unity Web Player for Facebook actions 1 Answer