I have added the following code which is working great on the Web but not on mobile devices the click event does not seem to be triggering.
var FacebookShare = function() {
this.method = 'feed';
this.name = 'A Name';
this.hashtag = '#YourHashtag';
};
$('#facebook-share').click((event) => {
let options = new FacebookShare();
options.quote = $(event.currentTarget.parentElement).find('h5').html()
facebookshare(event, options)
});
function facebookshare(event, options) {
event.preventDefault()
if(typeof(mobileApp) !== 'undefined'){
options.display = "touch"; //also tried iframe, popup
FB.ui(options,
function() {
console.log('shared');
})
}
}
I was able to find a workaround to this issue by overloading the following query string with a quote - which is the text you want to quote and an image (url). The only down fall was that I could not add a hashtag to my post but all in all it worked!