Enables integration between the application and Social Networking systems (currently Twitter and Facebook).
Required scripts
The SocialNetworkStatus object requires:
/*{{ javascript("jslib/socialupdates.js") }}*/
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.
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");
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!!!");
Summary
The version number of the SocialNetworkStatus implementation.
Syntax
var versionNumber = SocialNetworkStatus.version;
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;
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;