How do I "Prompt to share link" to facebook

Get help using Construct 2

Post » Thu Mar 23, 2017 10:43 am

Hi, - I have created an app on facebook, and have the ID and Secret etc, so I wanted to try out the facebook features in construct and I can get the login box to pop up,
however when I try any of the "prompt" share options, I don't see anything.

So in a really simple setup -

    one sprite,
    the faecbook object (with ID and Secret)
    the mouse object.

I say: on left button clicked on sprite - prompt to share link... and nothing pops up at all

Am I missing something?
B
16
S
4
Posts: 50
Reputation: 1,030

Post » Sun Mar 26, 2017 3:38 pm

You need to use AJAX to communicate with the Facebook developer API.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Mon Mar 27, 2017 7:23 am

Thanks for the reply.

Interesting, I may be naive about AJAX but it never came up when reading the documentation about the Facebook object:
https://www.scirra.com/manual/112/facebook

Is there anywhere else that explains AJAX in conjunction with it?
B
16
S
4
Posts: 50
Reputation: 1,030

Post » Mon Mar 27, 2017 6:17 pm

That is because the Facebook object (when did they add this?!) abstracts all of the AJAX/HTTP calls away, so you don't have to deal with them. They are still there, just hidden.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue Mar 28, 2017 9:21 pm

Pretty sure the Facebook object is broke.
Even in C3.
https://www.dropbox.com/s/5h8g3n0ufs22nil/c3fb.c3p?dl=0
Image ImageImage
B
168
S
50
G
163
Posts: 8,225
Reputation: 105,069

Post » Thu Mar 30, 2017 4:20 pm

That sucks if that's the case, any way to invoke the share to wall options via the AJAX/HTTP call 'old school' way?
B
16
S
4
Posts: 50
Reputation: 1,030

Post » Sun Apr 02, 2017 3:50 pm

JMKit wrote:That sucks if that's the case, any way to invoke the share to wall options via the AJAX/HTTP call 'old school' way?

Yea, look through the developer's API on Facebook (the link I shared above). Sometimes you can Google "Facebook API tutorial" to get more stuff too.

https://developers.facebook.com/docs/ja ... quickstart
https://developers.facebook.com/docs/ja ... t/examples

You want to look, specifically, for their GET and POST requests, then use AJAX "Request URL" for GET and "Post to URL" for POST, then you just have to process and use their replies.

Or it looks like they even have a pre-made share button for you to simply import on to your website:
https://developers.facebook.com/docs/pl ... re-button/

You might even be able to use an iFrame plugin to use it directly in C2.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Mon Apr 03, 2017 7:56 pm

Hey,
thanks for taking the time to share the links, it's appreciated :)
B
16
S
4
Posts: 50
Reputation: 1,030


Return to How do I....?

Who is online

Users browsing this forum: Manubis, Ryan Kocourek, TheSupreme, TylerJS and 10 guests