Sharing content (Sharing dialog)

A user can share its content through a “sharing” dialog by calling the share method on the ui module :

Oahu.ui.share( providerName, [opts], [callback] )

Where :

This method requires the user to be logged in with Oahu through the required provider. If it is not the case, the login box will appear.

See the following examples for more details.

Sharing with Facebook

When calling activity.share() with Facebook, the user ends up with Facebook’s own sharing dialog. You may use in the same options as you would with FB.ui

Oahu.ui.share("Facebook", {  
  method: 'feed',
  name: 'Facebook Dialogs',
  link: 'http://developers.facebook.com/docs/reference/dialogs/',
  picture: 'http://fbrell.com/f8.jpg',
  caption: 'Reference Documentation',
  description: 'Facebook sharing through Oahu'
});

Sharing with Twitter

When calling activity.share() with Facebook, the user ends up with Twitters’s own tweet dialog. Here is how to pre-load some data in it :

Oahu.activity.share("Twitter", { 
  label: "What's happening?"
  content: "Text to tweet" 
});