I am able to create a new player in my player collection in GS. Now I want to use the FB id which now resides in:
...,
"externalids: {"FB": "1234"}, ...
I have been following this tutorial here: https://drive.google.com/file/d/0ByRUWa2F2BklNV8zUWtpX19nTFk/view
but using GameSparks.Api.Requests.FacebookConnectRequest() method won't get that bit of info. This other tutorial that teaches how to get that info (https://docs.gamesparks.net/tutorials/unity-tutorials-challenges-part-3-user-manager) is out of date, or at least I am unable to puzzle it together and would really appreciate help.
Thanks!
Best Answer
M
Maria Mercedes Martinez
said
almost 7 years ago
Figured it out...To access the FB Id that I have on my GS server I use this
new AccountDetailsRequest().Send((response) =>
{
UpdateGUI(response.ExternalIds.GetString("FB"));
});
Then I pass the FB ID into this:
var www = new WWW("http://graph.facebook.com/" + facebookId + "/picture?width=100&height=100");
I made a Gameobject with an image component called profilePic and then swapped it out like this:
Maria Mercedes Martinez
Hi,
I am able to create a new player in my player collection in GS. Now I want to use the FB id which now resides in:
...,
"externalids: {"FB": "1234"}, ...
I have been following this tutorial here: https://drive.google.com/file/d/0ByRUWa2F2BklNV8zUWtpX19nTFk/view
but using GameSparks.Api.Requests.FacebookConnectRequest() method won't get that bit of info. This other tutorial that teaches how to get that info (https://docs.gamesparks.net/tutorials/unity-tutorials-challenges-part-3-user-manager) is out of date, or at least I am unable to puzzle it together and would really appreciate help.
Thanks!
Figured it out...To access the FB Id that I have on my GS server I use this
new AccountDetailsRequest().Send((response) =>
{
UpdateGUI(response.ExternalIds.GetString("FB"));
});
Then I pass the FB ID into this:
var www = new WWW("http://graph.facebook.com/" + facebookId + "/picture?width=100&height=100");
I made a Gameobject with an image component called profilePic and then swapped it out like this:
Image userAvatar = profilePic.GetComponent<Image>();
userAvatar.sprite = Sprite.Create(www.texture, new Rect(0,0,100,100), new Vector2(0,0));
Hope this helps someone else!
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstMaria Mercedes Martinez
Figured it out...To access the FB Id that I have on my GS server I use this
new AccountDetailsRequest().Send((response) =>
{
UpdateGUI(response.ExternalIds.GetString("FB"));
});
Then I pass the FB ID into this:
var www = new WWW("http://graph.facebook.com/" + facebookId + "/picture?width=100&height=100");
I made a Gameobject with an image component called profilePic and then swapped it out like this:
Image userAvatar = profilePic.GetComponent<Image>();
userAvatar.sprite = Sprite.Create(www.texture, new Rect(0,0,100,100), new Vector2(0,0));
Hope this helps someone else!
Juan David
Thanks,
Helped a lot :D
Maria Mercedes Martinez
Glad to hear it! I get so much help here, it feels nice to be able to give back!
1 person likes this
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics