Jump to content

Phaser js share score on Twitter


i3Designer
 Share

Recommended Posts

While there are ways to use the Twitter API, I usually use the following to share score on twitter :-

function tweetscore(){        //share score on twitter        var tweetbegin = 'http://twitter.com/home?status=';        var tweettxt = 'I scored '+tweetnumber+' at this game -' + window.location.href + '.';        var finaltweet = tweetbegin +encodeURIComponent(tweettxt);        window.open(finaltweet,'_blank');    }

The above opens a new window with a ready tweet that has the game score (tweetnumber) and also the game url (window.location.href). 

 

Facebook is a little more involved and I am still figuring it out. 

Link to comment
Share on other sites

  • 1 month later...

Thanks, thats help me !

 

in facebook you need to create a facebook app to get an api key and have access to custom text , if you dont use that you only cant have a link without custom text ( you can have a predefined text but cant update score p.e)

 

you can read about it here : 

http://stackoverflow.com/questions/20956229/has-facebook-sharer-php-changed-to-no-longer-accept-detailed-parameters

Link to comment
Share on other sites

If you're willing to get your hands a little dirty with the Facebook JavaScript API and the associated mini-hell that is setting up an app correctly, the Scores API is really nice.

 

Sorry yes, I know I'm not selling that brilliantly, and it has become easier in recent times, but it's still a huge pain in the ass :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...