Table Of Contents

Previous topic

10.33. The LoadingScreen Object

Next topic

10.35. The Floor Object

This Page

10.34. The SocialNetworkStatus Object

Enables integration between the application and Social Networking systems (currently Twitter and Facebook).

Required scripts

The SocialNetworkStatus object requires:

/*{{ javascript("jslib/socialupdates.js") }}*/

10.34.1. Methods

10.34.1.1. initialize

Summary

Initializes the social networking integration features based on the parameters passed in. This initialization may perform login procedures depending on the social networking systems being enabled. After calling this method any status updates or messages will be sent to the enabled systems.

Syntax

var params = {
    useTwitter: true,
    minTimeBetweenTweets: 120,
    postStatusAsTweet: false,
    useFacebook: false
};
SocialNetworkStatus.initialize(params);

Note

Facebook integration requires additional JavaScript to be included in the game page.

Note

Twitter integration requires server support for posting tweets.

10.34.1.2. setStatus

Summary

Used to set a players ‘status’. This method is intended to be called more frequently than addMessage and will change a ‘status’ field in the Social Network members profile.

Syntax

SocialNetworkStatus.setStatus("Joined a new multiplayer session in Super Fun Game");

10.34.1.3. addMessage

Summary

Adds a message to the players Social Network page, e.g. posting a tweet on Twitter or writing a message on the users wall for Facebook. This method is intended to be called at less frequent intervals than setStatus to avoid ‘spamming’ Social Network pages.

Syntax

SocialNetworkStatus.addMessage("Just achieved a new rank with 1000 points!!!");

10.34.2. Properties

10.34.2.1. version

Summary

The version number of the SocialNetworkStatus implementation.

Syntax

var versionNumber = SocialNetworkStatus.version;

10.34.2.2. minTimeBetweenTweets

Summary

Sets the time in seconds to wait before posting a new tweet. Any messages added before the time has passed will be grouped into a single post

Syntax

SocialNetworkStatus.minTimeBetweenTweets = 60;

10.34.2.3. postStatusAsTweet

Summary

Sets whether or not a call to setStatus should create a tweet. In some games setStatus may be called too frequently for the purpose of generating tweets.

Syntax

SocialNetworkStatus.postStatusAsTweet = true;