Cocoon.Share class provides a multiplatform, easy to use native Share API.
Methods
-
<static> share(callback)
-
Opens a given share native window to share some specific text content in any system specific social sharing options. For example, Twitter, Facebook, SMS, Mail, ...
Parameters:
Name Type Description callback
function callback. The callback params called when share completed or dimissed. Params: activity, completed, error
Properties:
Name Type Description data
object The data to share
Properties
Name Type Description message
string The message that will be shared.
image
string The image that will be shared. It can be a URL or a base64 image.
Example
Cocoon.Share.share({ message: "I have scored more points on Flappy Submarine!! Chooo choooo", image: "http://www.myserver.com/myimage.png" }, function(activity, completed, error){ console.log("Share " + completed ? 'Ok' : 'Failed'); });