I am trying to implement facebook social plugin in webview like official android 9gag app has in comments.
My html which i am loading into webview looks like this
<html>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '$APP_ID$', // App ID from the app dashboard
channelUrl : '$DOMAIN$/channel.php', // Channel file for x-domain comms
cookie : true,
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return;}
js = d.createElement(s); js.id = id;
js.async=true; js.src = "//connect.facebook.net/cs_CZ/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" data-href="$FB_SOCIAL_URL$" data-width="470" data-num-posts="10"></div>
</body>
</html>
But when i load this into webview nothing happened. When i use it on desktop nothing happen either. Only blank screen is shown. I also tried to implement settings for webview from this answer Android unable to implement facebook comment in a webview due to default browser bud it didnt change nothing. I dont want to load all url with that facebook plugin but only that plugin itself. Any ideas?