Construct 2 and Facebook plugin?

Just started using Construct 2? Post your questions here

Post » Sat Dec 27, 2014 9:48 pm

Yes, i have read manual, and tutorials section on this website and i searched forum, but I still cant manage to get Facebook functions in my game. After 5 hours of research i decided to post question here
I already added Facebook object and entered APP ID and APP Secret, I also made app public and available to all users.
Facebook login is not working. I added "Log in" action to "On tap gesture" of button, but when i click on this button nothing happens.

You can also download my project file, so you can see what i did (check "Start Event" sheet). I also removed APP secret from project file.
You do not have the required permissions to view the files attached to this post.
B
14
S
3
G
1
Posts: 95
Reputation: 1,015

Post » Sat Dec 27, 2014 10:05 pm

it has something to do with your button object, if a replace it with a sprite object everything works great
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615

Post » Sat Dec 27, 2014 10:14 pm

yea Button uses On Clicked, not tap gesture
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Dec 28, 2014 12:29 am

Thanks! That helped me alot! Now i have some other question.
How can i get facebook profile picture inside Construct 2?
I tried creating empty sprite end then loading picture from url with this expression: "https://graph.facebook.com/" & Facebook.UserID % "/picture", but i get nothing... IDK why.
B
14
S
3
G
1
Posts: 95
Reputation: 1,015

Post » Sun Dec 28, 2014 10:57 pm

Hopefully someone with experience with this plugin can help.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Dec 28, 2014 11:40 pm

ButcherZV wrote:Thanks! That helped me alot! Now i have some other question.
How can i get facebook profile picture inside Construct 2?
I tried creating empty sprite end then loading picture from url with this expression: "https://graph.facebook.com/" & Facebook.UserID % "/picture", but i get nothing... IDK why.


"https://graph.facebook.com/" & Facebook.UserID & "/picture"

the & is your problem i think, because it works when i try it
Read this:
yeah, i really like to say that you should "Read this:"
B
13
S
6
Posts: 138
Reputation: 1,615

Post » Mon Dec 29, 2014 12:23 am

@EyeForcz,

That old way to get the profile picture stopped working with the last couple of Facebook API updates. In order to get the profile picture now you would need to use the ajax plugin and either my free Facebook core plugin(non mobile) or cranberrygames plugin for mobile platforms. Once you log in using on of the plugins just mentioned, make an ajax get call to the following address
https://graph.facebook.com/me/picture?r ... ess_token={User Access Token from mine or cranberrygames plugin}

This returns a JSON array that you can parse to get just the url value. IF you are not good at that, you could just use the tokenat system expression to strip it down to just the url you want.

Of course you can also pick up my user information plugin to streamline the information. It's compatible with Cranberrygames plugin as well. You can pick it up at http://lockegames.com
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835

Post » Mon Dec 29, 2014 12:40 am

Wait, does the "https://graph.facebook.com/" & Facebook.UserID & "/picture" actually work? It shouldn't but maybe :) I havent tried it.
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests