Share Facebook on iOS & Android [solved]

Get help using Construct 2

Post » Mon Apr 28, 2014 12:54 pm

@Collodium
Thanks for helping out! After encoding the text it now works!
B
5
S
1
Posts: 7
Reputation: 399

Post » Sat May 10, 2014 10:10 pm

what you encode exactly ? only linkswith http or all
B
46
S
16
G
8
Posts: 800
Reputation: 8,347

Post » Sat May 10, 2014 10:17 pm

@matrixreal, I suggest you encode each section of the link where there are spaces. Once you have a link with zero spaces then you should be good to go.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Sun May 11, 2014 1:34 am

hi
can you just tell me if its encoded properly :

"https%3A%2F%2Fwww.facebook.com%2Fdialog%2Ffeed%3Fapp_id%3DMYID&display=popup&caption=%20Check%20out%20my%20MyGame%20score%20of%20%24%22%26%20HighScore%20&
&link=http%3A%2F%2Fflappy2bird.blogspot.fr%2F&redirect_uri=http%3A%2F%2Fwww.facebook.com%2F&name=MyGame&description=Can%20you%20beat%20my%20score%3F"

and i dont think that work with ejecta
B
46
S
16
G
8
Posts: 800
Reputation: 8,347

Post » Sun May 11, 2014 4:30 am

Whatever you want to link to should first work if you were to just copy-paste it into your browser window. If it won't pass that test then there's something wrong. I can't get your link to work, because:

your app id is "MYID" - you need a proper Facebook app id number here.

caption= Check out my MyGame score of $"& HighScore &
&link=http://flappy2bird.blogspot.fr/

- there's a hard return and two &'s next to each other when this is decoded.

and decoding the last part:

redirect_uri=http://www.facebook.com/&name=MyGame&description=Can you beat my score?"

Is your game registered on Facebook as MyGame? If not, that might cause a problem...
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Sun May 11, 2014 4:56 am

hi,
thanks for quick reply
i want that player share his score on his own facebook account and not to specific facebook page ? you understand me
sorry for my bad english
B
46
S
16
G
8
Posts: 800
Reputation: 8,347

Post » Sun May 11, 2014 5:10 am

@matrixreal, as far as I understand, I think you need to have your game registered with facebook for the share to work. When you then share, you'll see that it goes directly to the player's page and that it is only directed through your registered game to enable this to happen. It's still not totally clear to me even now...
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Sun May 11, 2014 5:49 am

mmm ok i understand you
but ... are you sure that this work with ejecta ?
and you use browser plugin ? (because i just try it with browser plugin simple go to "http://facebook.com" for exemple and nothing happen , it not open facebook page)
B
46
S
16
G
8
Posts: 800
Reputation: 8,347

Post » Sun May 11, 2014 12:19 pm

@matrixreal, for me - yes it works. It sounds like it could be a problem with your events but I can't really help without seeing them. I have never had any problem linking inside ejecta to open a default browser window on iOS (which doesn't directly help you, but it means that there is a solution!).

Here's the string that I use to open up a new browser window. I have sub-events to replace the XX and ZZ with more string info depending on what the user has just done - ie the reason for the wall post. I have replaced my app id here with YY as well.

Code: Select all
https://www.facebook.com/dialog/feed?app_id=YY&link=ZZ&picture=https%3A%2F%2F24.media.tumblr.com%2F297f80fc891de7f6da2578fee2a97c9e%2Ftumblr_n3mqo7aWXo1txhoh7o1_r1_400.png&name=I%20was%20just%20in%20a%20meeting%20that%20cost%20DDXX!%20&caption=%20&description=Cost%20That%20Meeting%20-%20available%20on%20iOS%20%26%20Android.&redirect_uri=http%3A%2F%2Fwww.facebook.com%2F


As you can see, the name and description parts have been encoded so that there are no spaces.

My final browser command is

Code: Select all
Browser : go to FB_URL in a new window ("New Window")


where FB_URL is the final string for the URL. If none of this works, can you post a screen shot of your event sheet?
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,284
Reputation: 47,552

Post » Sun May 11, 2014 1:10 pm

ok
about creating facebook id (game developper)
i need just to create one to get an ID or i have to send it to be approved in facebook ?
really it confuse m
B
46
S
16
G
8
Posts: 800
Reputation: 8,347

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 12 guests