I made a Sencha Touch app built with PhoneGap and hosted on both major store (Google Play and Apple Store) with a FB share function. I've used the "FacebookConnect" plugin of PhoneGap (https://github.com/phonegap/phonegap-plugins/tree/master/Android/FacebookConnect). I've used the folowing code to share a link:
window.plugins.facebookConnect.dialog('feed',
{
link: mylink,
picture: mypicture, // provide not a local url. otherwise, FB does not display nothing and rises an "FBCDN image is not allowed in stream" error
name: myname,
caption: mycaption,
description: mydescription
},
function(response) {
console.log("FacebookConnect.dialog:" + JSON.stringify(response));
}
);
If not already logged in on FB (using, for example, the FB native app if installed), the plugin will show the web-based login window to the user before open the share dialog.
Before that, remember to init the FB API using something like that somewhere in your app:
window.plugins.facebookConnect.initWithAppId(FBID, function(result) {
console.log("FacebookConnect.initWithAppId: " + JSON.stringify(result));
// Check for cancellation/error
if(result.cancelled || result.error) {
console.log("FacebookConnect.initWithAppId:failedWithError: " + result.message);
return;
}
});
also remember to NOT call the FB API login method at the startup of the app,otherwise Apple will reject application.
I hope this is useful to your project.