Namespace: Social

Cocoon. Social

This namespace provides an abstraction API for all the Social Services. Each Social service has it's own official API but can also be used within this API interface.
Note that this javascript extension can be used to manage Leaderboards and Achievements.
In order to understand how to use the social javascript extension refer to the social service you would like to to use:

Namespaces

Facebook
GameCenter
GooglePlayGames
Interface

Members

<static> Achievement

This object represents the possible Time Scopes for a leaderboard query.

Properties:
Name Type Description
Cocoon.Social.Achievement object

The object itself

Properties
Name Type Description
achievementID string

The id of the achievement info.

customID string

The optional custom id of the achievement defined by the user.

title string

The title of the achievement.

description string

The description of the achievement.

imageURL string

The url to the image representing the achievement.

points number

The points value of the achievement.

<static> ImageSize

This object represents the possible images that can be obtained for a user in the social gaming extension.

Properties:
Name Type Description
Cocoon.Social.ImageSize object

The object itself

Properties
Name Type Description
THUMB string

Represent a thumbnail like image size.

SMALL string

Represents the small image size.

MEDIUM string

Represents the medium image size.

LARGE string

Represents the large image size.

<static> Message

This object represents a message to be published.

Properties:
Name Type Description
Cocoon.Social.Message object

The object itself

Properties
Name Type Description
message string

The message to be published.

mediaURL string

An URL to a media (image, video, ...).

linkURL string

An URL to add to the message so the user can click on that link to get more information.

linkText string

The text that will appear in the message link.

linkCaption string

The text caption that will appear in the message link.

<static> Score

This object that represents the information of the user score in the application.

Properties:
Name Type Description
Cocoon.Social.Score object

The object itself

Properties
Name Type Description
userID string

The user id.

score number

The score of the user.

userName string

The name of the user.

imageURL string

imageURL The url of the user image.

leaderboardID number

The id of the leaderboard the score belongs to.

<static> ScoreParams

The object that represents params to retrieve or submit scores.

Properties:
Name Type Description
Cocoon.Social.ScoreParams object

The object itself

Properties
Name Type Description
userID string

The user id. If no userID is specified the current logged in user is assumed.

leaderboardID number

The leaderboard ID. If no leaderboard is specified the default leaderboard is assumed.

friends boolean

If enabled the query will get only scores from friends in the social network.

timeScope Cocoon.Social.TimeScope

The time scope for the scores.

<static> TimeScope

This object represents the possible Time Scopes for a leaderboard query.

Properties:
Name Type Description
Cocoon.Social.TimeScope object

The object itself

Properties
Name Type Description
ALL_TIME string

All registered time.

WEEK string

A week.

TODAY string

Today.

<static> User

The object that represents the information of a user inside the social gaming extension.

Properties:
Name Type Description
Cocoon.Social.User object

The object itself

Properties
Name Type Description
userID string

The id of the user.

userName string

The user name of the user.

userImage string

If the image URL is not provided by default, fetch it using requestUserImage method.

Atomic Plugins - JavaScript Documentation by Ludei, DocStrap Copyright © 2012-2013
The contributors to the JSDoc3 and DocStrap projects.