Hi I just had found out that FB.api showing an error that 'This dialog is not available on this device'. I also do some research about and the answer almost it was almost 3 years ago. For now my question, is there a new update for that I can able to create my own custom fb send button? that when I click on it, it will display a new window or popup. just like whatsapp share button, and line app. thanks in advanced, I want to learn more about this FB API.
as for now i'm using the FB api, try this if it's show something also
<div id="send" class="messenger-share">
<i class="fa fa-messenger"></i>
</div>
<script>
$("#send").click(function() {
FB.ui({
app_id: '665679653572224',
method: 'send',
link: "<?php the_permalink(); ?>",
});
});
</script>
I created a fiddle to do this, you can see it here.
https://jsfiddle.net/jimedelstein/14mv8kms/2/
All you need to do is replace the URL (I commented it pretty explicitly).
You want to dynamically load the latest facebook api like so
window.fbAsyncInit = function() {
FB.init({
appId: '665679653572224',
xfbml: true,
version: 'v2.5'
});
};
(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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
Since you posted your appId, I updated the init script to use it.
Then, connect the FB.ui "share" call like so:
$("#send").click(function() {
FB.ui({
method: 'share',
href: "<?php the_permalink(); ?>"
}, function(response) {});
});
For more information, I suggest you checkout the documentation that Facebook provides here: https://developers.facebook.com/docs/javascript