Hello.
I was wondering if it was possibly to make calls to the Facebook OpenGraph API, so my code is what's wrong.
Basically, is this Unities security, or is it my code...
Everything I do, will not return the correct data
IEnumerator Load()
{
//Security.PrefetchSocketPolicy("www.facebook.com", );
while (!CookieCutter.IsLoaded())
{
yield return StartCoroutine(WebUtils.WaitFor(0.1f));
}
string cookieValue = CookieCutter.GetCookie(theLimitCookieName);
if(string.IsNullOrEmpty(cookieValue))
{
cookieValue = CookieCutter.GetCookie(debugCookieName);
}
// --- Hash the cookie values
if (!string.IsNullOrEmpty(cookieValue))
{
cookieValue = cookieValue.Trim('\"');
string[] nameValues = cookieValue.Split('&');
Hashtable hashTable = new Hashtable();
foreach (string element in nameValues)
{
string[] splitElement = element.Split('=');
if(splitElement.Length == 2)
hashTable[splitElement[0].Trim('"')] = splitElement[1].Trim('"');
}
long.TryParse((string)hashTable["uid"], out _uid);
_accessToken = (string)hashTable["access_token"];
}
t = "LoadFriends : " + UID;
// --- Now lets do a web call
WWW fbFriendsReq = new WWW("https://graph.facebook.com/me/friends?access_token=" + UID);
yield return WebUtils.WaitForRequest(fbFriendsReq);
// --- these calls never return the correct data...isDone = false, and error is undefined
t = "Returned from WebUTils : Done : " + fbFriendsReq.isDone + " Error : " + fbFriendsReq.error;
t = "Recieved Friends : " + fbFriendsReq.text;
// --- Execution never makes it here
_friends = FacebookFriends.CreateFromJSON(fbFriendsReq.text);
t = "Friends Created From JSON";
yield return WebUtils.WaitFor(0.01f);
}