How can we implement Add to any social network widget to share photos in facebook,twitter etc in Mobilefirst platform. I have tried the plugin from http://www.addthis.com/
Update: see this blog post for more information: https://developer.ibm.com/mobilefirstplatform/2015/08/03/integrating-3rd-party-cordova-plug-ins/
The mentioned "plug-in" does not seem fitting for mobile apps IMO.
You can google for Cordova social sharing plug-ins instead.
One promising such plug-in for Android, iOS and Windows Phone is the PhoneGap Social Sharing plugin.
Note: You cannot use the Cordova CLI installation steps to install the plug-in in Worklight/MobileFirst Platform. Instead, you need to follow the manual instructions that are provided.
Before doing so it would be prudent to read the MFP tutorial for working with Cordova plug-ins so you will understand how it works in MFP.
I got it to work on iOS with some extra tweaks.
Note:
Steps:
Updating (in Xcode) www\worklight\cordova_plugins.js with an extra section
{
"file": "../js/SocialSharing.js",
"id": "nl.x-services.plugins.socialsharing",
"clobbers": [
"window.plugins.socialsharing"
]
}
Note: SocialSharing.js should be placed in common\js as well as be referenced to in the HEAD element in index.html
Edit SocialSharing.js by wrapping the entire contents with
cordova.define("nl.x-services.plugins.socialsharing", function(require, exports, module) {
// file contents
);
In your HTML, choose whichever sharing option you'd like from the available ones (see plug-in documentation for those).
End result: