How do I get email of user entering in game thru fb login?

Get help using Construct 2

Post » Wed Oct 25, 2017 4:26 am

Hi All,

I need help in capturing email id of user when he enters in construct 2 game using fb login. I am using construct 2 fb object only. Right now it can display only username and profile pic. How can i get fb email id of the player so that user need not to fill his email id in the form and it will be feteched automatically from facebook?

Thanks & regards,
Jatin
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Post » Wed Oct 25, 2017 11:14 am

In order to get user emails you must request users permission when authenticating, so, when you use the Login action in the Facebook object include "email" in the list of permissions you're requesting. You can find a very complete list of permissions for the Facebook Graph API here: https://developers.facebook.com/docs/fa ... ermissions.

Image

Also, remember that, as mentioned in Facebook Graph API manuel, "All these permissions, except the default, public_profile, require that you have Client OAuth Login enabled for your app on the Facebook Login tab of your app dashboard."

Once you have the permission you can do a request to the Facebook Graph API via AJAX.

Hope this helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026

Post » Thu Oct 26, 2017 4:06 am

brunopalermo wrote:In order to get user emails you must request users permission when authenticating, so, when you use the Login action in the Facebook object include "email" in the list of permissions you're requesting. You can find a very complete list of permissions for the Facebook Graph API here: https://developers.facebook.com/docs/fa ... ermissions.

Image

Also, remember that, as mentioned in Facebook Graph API manuel, "All these permissions, except the default, public_profile, require that you have Client OAuth Login enabled for your app on the Facebook Login tab of your app dashboard."

Once you have the permission you can do a request to the Facebook Graph API via AJAX.

Hope this helps. Cheers!


Hi brunopalermo,

Thanks a lot for quick reply. Really appreciate it. After taking email permission, how to get email displayed in text box. Consstruct 2 object allows full name to be shown inside text box but nothing there for email id. I am not a php or Ajax guy. It will be really big help if you can show me the path for capturing email id in a textbox after user login through FB. I am sharing my capx made for fb login. can you modify it and help me to get email id?
https://touch.affle.com/explorations/mohan/fblogin.capx
Regards,
Jatin
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Post » Thu Oct 26, 2017 12:04 pm

The C2 Facebook plugin cannot retrieve emails. But there's a modified version of it that can:
https://www.scirra.com/forum/plugin-mod-to-facebook-plugin-email-and-token_t76595
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Fri Oct 27, 2017 8:24 am

AekiroStudio wrote:The C2 Facebook plugin cannot retrieve emails. But there's a modified version of it that can:
https://www.scirra.com/forum/plugin-mod-to-facebook-plugin-email-and-token_t76595


Thanks Aekiro studioz for sending reply. I tried first link in the post and it is not available.
Second link from @Nandynho ! is incapable of getting email id. Though this plugin can get gender info but I don't require that. My main requirement is email id of fb user. Can you further help me out in same?

Regards,
Jatin
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Post » Fri Oct 27, 2017 11:46 am

This is the official Facebook plugin + Email expression
https://ufile.io/f1p4k

1- You login with facebook
2- You can retrieve the email in the "on name available" using the email expression
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Fri Oct 27, 2017 11:59 am

AekiroStudio wrote:This is the official Facebook plugin + Email expression
https://ufile.io/f1p4k

1- You login with facebook
2- You can retrieve the email in the "on name available" using the email expression


Thanks a lot. It s working like dream now.
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Post » Fri Oct 27, 2017 12:37 pm

AekiroStudio wrote:The C2 Facebook plugin cannot retrieve emails. But there's a modified version of it that can:
https://www.scirra.com/forum/plugin-mod-to-facebook-plugin-email-and-token_t76595


Hi Aekira,

Is it possible to get friends list who are playing same game and display scores to compete with them using this plugin?

Regards,
Jatin
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Post » Fri Oct 27, 2017 1:13 pm

Yes, use the "Request hi-score board" action.
Then "On hi-score" event you can retrieve the info about each entry in the leaderboard (HiscoreName, HiscoreRank)


More infos:
https://www.scirra.com/manual/112/facebook
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Fri Oct 27, 2017 4:37 pm

AekiroStudio wrote:Yes, use the "Request hi-score board" action.
Then "On hi-score" event you can retrieve the info about each entry in the leaderboard (HiscoreName, HiscoreRank)


More infos:
https://www.scirra.com/manual/112/facebook

Thanks again . will try it and share it here.
Image
B
89
S
31
G
2
Posts: 133
Reputation: 8,484

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests