Trying to parse Facebook FQL response with String.Split in webplayer; no luck

I finally worked out how to do it on the html side of things, I am successfully getting the entire into a String ( which I have verified with console.log ) and sending it to the Unity webplayer.
But then I am failing to decode it in Unity, which should have been the easy part.

I can’t figure out what I’m doing wrong here.

function ParseFQLResponse (inString : String)
var chopChar : char[] = new char[1];
chopChar[0] = ";"[0];
var diceChar : char[] = new char[1];
diceChar[0] = ","[0];

var chop : String[] = inString.Split(chopChar);
for (var p : int = 0; p < chop.Length; p++)
	var dice : String[] = chop[p].Split(diceChar);
	if (dice.Length == 4)
		playerText.text = "oops "+dice.Length;
playerText.text = fbFriendIDs.Count+","+fbFriendNames.Count+","+fbFriendsOnline.Count+","+fbFriendsWithGame.Count+"  "+fbFriendIDs[0]+" "+fbFriendNames[0]+" "+fbFriendsOnline[0]+" "+fbFriendsWithGame[0];

This gives me the message “oops 1”. The second message never appears.

This is the Javascript function on the webpage where the player is embedded:

function OnUnityReady()
	var outString = "";
	FB.api('fql', {q : 'SELECT uid, first_name, online_presence, is_app_user FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me())'}, function(response) {
		for (var i = 0; i <; i++)
			outString += (<em>.uid + "," +<em>.first_name + "," +<em>.online_presence + "," +*.is_app_user + ";");*</em></em></em>

* }*
* console.log(outString);*
* });*
GetUnity().SendMessage("MasterControl",“ParseFQLResponse”,outString); *

This is a classic example of why doing some testing is so critical. You’re trying to do a facebook thing, I know, but in reality, all that ParseFQLResponse() does it break up a string that you send it. So, make up some simple tests:


Obviously you’ll want to comment out the call into ProcessFBFriendList(). Do this from Unity, and add debugging code to your function to see what actually happens. My suspicion is that the Split("fred;", ";") will give you two results, fred and an empty string, where you expect to get just a single value back.