I am using this plugin on my website. This will enable people to write their comment on fb comment box.
This link will give you the comment plugin code: https://developers.facebook.com/docs/plugins/comments#configurator
Then I try adding it on my hybrid mobile app.
Here is an example code:
<div id="fb-root"></div>
<script>(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/sdk.js#xfbml=1&version=v2.7";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5"></div>
At first I have an error here. I just changed this line:
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
to js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
The error disappeared but still the comment box doesn't show.
They say it should not be run locally and you need to host your html file on a server.
If hybrid app don't have a host (just local file), how can I show the comment box?
Copyright Notice:Content Author:「c.k」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38911010/facebook-comment-plugin-in-hybrid-mobile-app-not-showing