- Home /
Question by
Gucci Gagan · Mar 01, 2014 at 12:38 AM ·
texturefacebookscorengui
How to get Facebook friend's name, score, and picture
The FriendSmash sample is kind of hard to follow and i was wondering if anybody had just a simple way to retrieve these using the Unity Facebook SDK?
Please help!
Thank you!
PS: if possible, how do you put each friend's profile picture in an NGUI UITexture?
Comment
Answer by Mgayar · Feb 01, 2015 at 11:34 PM
Use this function to get the picture
public static string GetPictureURL(string facebookID, int? width = null, int? height = null, string type = null)
{
string url = string.Format("/{0}/picture", facebookID);
string query = width != null ? "&width=" + width.ToString() : "";
query += height != null ? "&height=" + height.ToString() : "";
query += type != null ? "&type=" + type : "";
query += "&redirect=false";
if (query != "") url += ("?g" + query);
return url;
}
Your answer
Follow this Question
Related Questions
Facebook SDK - “FB.API” not saving or loading scores 1 Answer
3D ^ Custom GUIText/Label or Making a Score System without using GUI? 0 Answers
Facebook SDK doesn't work in Smartphones 0 Answers
Get Facebook User name with Facebook sdk Unity android 3 Answers
"Facebook object not loaded yet" error 3 Answers