Hey, ya’ll. I’m having a noob problem getting data from an IDictionary.
What’s happening is I have a sync friends action that a user can trigger. This returns their Facebook friends’ IDs that use the game.
The result looks like this
{
"data": [
{
"id": "4687861231"
},
{
"id": "4861248864"
}
],
"paging": {
"cursors": {
"before": "ghjgkfdgsdg",
"after": "dghjgjkdssdffg"
}
},
"summary": {
"total_count": 20
}
}
From my debugging, I see that “data” is a type of List<Object>
the exact debug log of the key “data” is Key = data , Value = System.Collections.Generic.List`1[System.Object] , Type = System.Collections.Generic.List`1[System.Object]
So, I create and cast a variable as such and declare it as so List<Object> data = result["data"] as List<Object>;
My question is, what is the correct way to iterate through this list to get the IDs?
Thanks for your time! I really appreciate it.