How do I invite friends with Facebook plugin

Get help using Construct 2

Post » Sat May 03, 2014 8:25 am

Can any body help me how to invite friends using Facebook plugin?
B
7
S
1
Posts: 19
Reputation: 867

Post » Sat May 03, 2014 10:25 am

Hi,

Using the plugin is very complicated. You have to create a fresh plugin for this to work.
You have to manually create Actions / conditions / expressions in runtime.js and edittime.js in exporters/html5/plugins/facebook folder. For this approach you can check the following tutorials written a long time back:
https://www.scirra.com/tutorials/445/facebook-how-to-get-a-list-of-friends
https://www.scirra.com/tutorials/446/facebook-how-to-invite-a-friend

If you find it difficult, the alternative, I think is to custom update c2runtime.js in the exported app folder.
This is the process I followed:

1. Use browser object in the project
2. In the event where you want to invite friends, set the action "go to URL". In the URL field, enter any identifiable text. For Example "Haider Is Great"
3. Export the project to HTML5
4. Open C2runtime.js.
5. In C2runtime.js, define your own JS code to request FB for "invitable friends" and Creating a Multifriend selector
6. In C2runtime.js, search for Haider Is Great (cntrl+f). Here you'll find "Got to URL" function.
7. Replace "Got to URL" function, with the function name you created.

On top of this you'll need send request to friends also.

Looks complicated. But it is simple. The code examples are available on Facebook developers document pages.
You'll need to go through the following:
1. Canvas game tutorial (will give you code for sending friend requests)
2. Invitable Friends - this is a new feature and it is very useful (will give you necessary code for getting the friend's list)
3. Multi-Friend Selector - (will give you code for creating menu to select the friends to whom request has to be sent)

Let me know if this is helpful.
I'm not a programmer, but I know that my JS developer implemented this in my project.
If possible, I'll post screenshots of this process later.


Cheers,
Capper
B
7
S
1
Posts: 15
Reputation: 465

Post » Mon May 05, 2014 3:55 pm

thanks and hope it would be simple
B
7
S
1
Posts: 19
Reputation: 867


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, Yahoo [Bot] and 49 guests