Nellykey Posted June 1, 2017 Share Posted June 1, 2017 Hi, I`m implementing facebook share button in my game. I`ve made with sharing pic and some description using code like this: var prefix = "https://www.facebook.com/sharer/sharer.php"; var text = "?t=Check+it!" var gameUrl = "&u=" + window.location.href; var postfix = "?mbid=social_fb_onsiteshare"; var url = prefix + text + gameUrl + postfix; var win = window.open(url, '_blank'); win.focus(); And I get picture from open graph: <meta property="og:title" content="Post Title" /> <meta property="og:image" content="url" /> As you can see now I use the same picture and text for each player. But I want to share game screenshot and title "I got N scores!" with users highscore. How can I make it? Quote Link to comment Share on other sites More sharing options...
mattstyles Posted June 1, 2017 Share Posted June 1, 2017 Thats the old (and I think deprecated) way of sharing stuff with facebook. You'll need to register your site as an app with FB and use the FB api to post more interesting things, their documentation isn't as clear as it could be and I haven't found any clear and up-to-date tutorials either (I use to do this sort of thing semi-regularly for clients and always rued not making a dedicated library for myself, I always forgot how to do it properly and had to go look up the docs each time, stupid stupid). Once you've registered yourself with FB, which is easy and pretty quick, you can do a lot of powerful and interesting things with their api, plus they can do a good analytics job for you as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.