The old Social Message plugin
Almost a year ago, I wrote an open source plugin for PhoneGap / Cordova. The plugin allowed PhoneGap developers to easily post messages from their app to services like Facebook and Twitter utilising the native share features.
New plugin architecture
If you’re a developer for PhoneGap / Cordova, you’ve probably noticed that with the version 3.0 CLI installing plugins is really easy. The only drawback is that older plugins will need to be updated to work.
I’m pleased to announce, my Social Message plugin has been rewritten to support the “add plugin” command.
1 step install
After your deviceready event has been fired, you can simply pass a message object with a “text” property to the send function:
The above code will allow the message to be shared with all built in activity types. If you want to specify activity types to include, add an “activityTypes” array to your message object:
This example will allow the user to only post the message to Facebook or Twitter.
A complete list of activity types can be found here. You should omit the “UIActivityType” prefix when adding to your array.
The plugin is currently only implemented for iOS but I’m working on Android and Windows Phone 8 support, based on my old plugin and using the new standard.
Just a thought…
Wouldn’t it be great if there was some kind of plugin registry like node package manager… cough