.. index:: single: SocialNetworkStatus .. highlight:: javascript ------------------------------ 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") }}*/ Methods ======= .. index:: pair: SocialNetworkStatus; initialize `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. .. index:: pair: SocialNetworkStatus; setStatus `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"); .. index:: pair: SocialNetworkStatus; addMessage `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!!!"); Properties ========== .. index:: pair: SocialNetworkStatus; version `version` --------- **Summary** The version number of the SocialNetworkStatus implementation. **Syntax** :: var versionNumber = SocialNetworkStatus.version; .. index:: pair: SocialNetworkStatus; minTimeBetweenTweets `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; .. index:: pair: SocialNetworkStatus; postStatusAsTweet `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;