totallybueno Posted November 27, 2015 Share Posted November 27, 2015 Hi there,I have my game made with Phaser (and compiled with cocoon.io) and on the leadersboard state I want to let the user to post his score on Facebook. Well, I created an App on Facebook and I´m not finding a good solution to create this simple post, something like "I scored 10 points on this riduculous game..." Pretty easy on Twitter and not so easy on Facebook, I can find information about posting links and that stuff but I´m not finding a proper way to create a simple post just with text. How do you guys do this? I guess I´m missing something, it shouldn´t be so complicated. Cheers, Jorge. Quote Link to comment Share on other sites More sharing options...
icp Posted November 27, 2015 Share Posted November 27, 2015 Since your app is hybrid you can use this plugin :https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-PluginIf you want a pure JS experience without native components you can consult the facebook js sdk:https://developers.facebook.com/docs/javascript/examples totallybueno 1 Quote Link to comment Share on other sites More sharing options...
Gio Posted November 27, 2015 Share Posted November 27, 2015 Short answer: if you are looking for a simple method, then it is not possible. The one simple thing you can do, is use the deprecated sharer.php. This lets you share a link, but it doesn't let you specify what default text should go in the link description. It used to be possible to do that, but no more.'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent('http://www.mywebsite.com');But like I said, sharer.php is now deprecated and unsupported / undocumented. The way to do these things now is through the Feed Dialog interface. But to do that, you need to use the Facebook JavaScript SDK and/or have your app registered as a Facebook app, and therefore you need to be prepared to enter a world of pain and misery, where things that work today will no longer work tomorrow and require periodical complete rewrites. Also this paragraph from the documentation of Feed Dialog is worth noting: If a person has the "Who can post on your timeline?" setting set to "Only me" and another person tries to make a post to the first person's timeline using the Feed dialog, it will display a "Cannot post" error. mattstyles 1 Quote Link to comment Share on other sites More sharing options...
totallybueno Posted November 28, 2015 Author Share Posted November 28, 2015 Thanks guys, I tried the plugin that icp said and it´s awesome, works ever better than expected, a treasure! Thanks mate, seriously, I do love this Now I only have a tiny problem and it´s with the desktop version of the game on Facebook... The docs really suck and even the whole ecosystem stinks... I think that for this case I´m gonna use a normal window.open to a Facebook page and that´s all, I shouldn´t be so "complicated" to post something on Facebook... see you another day Zuckerber. 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.