How do I get message_tags right in corona sdk?

So I’m doing this

So I’m trying to post an image to my own wall with tags of friends.

local function onLoginSuccess(friends)         local attachment = {             message = " ??????. ",             source = { baseDir=system.DocumentsDirectory, filename="picture.jpg", type="image" },             message\_tags = friends,         }         facebook.request( "me/photos", "POST", attachment ) end  

But I could not get message_tags format correctly and it bounces. 

They say in an obj C, it should be something like this.

"message\_tags": { "18": [{ "id": "##########", "name": "Abc Def", "type": "user", "offset": 18, "length": 7 }], "7": [{ "id": "##########", "name": "AbcD", "type": "user", "offset": 7, "length": 4 }] }  

But since Corona doesn’t have arrays and stuff, I couldn’t figure out what would work.

Please help me!

Have you tried:

        local attachment = {             message = " ??????. ",             source = { baseDir=system.DocumentsDirectory, filename="picture.jpg", type="image" },             message\_tags =             {                  "id": "##########",                  "name": "Abc Def",                  "type": "user",                  "offset": 18,                  "length": 7            },         }         facebook.request( "me/photos", "POST", attachment )

Yup I have and I tried again when you asked.

The thing is, message_tags is an array of friend objects. And what I thought would work would be to do this

-- friends is a list of user object returned from showDialog where you can choose friends. mt = {} for i,v in pairs(friends) do     mt[i] =                         {id= v.id,                          name= v.fullName,                          type= "user",                          offset= i,                          length= 7} end local attachment  = {       message = " ??????. ",       source = { baseDir=system.DocumentsDirectory, filename="picture.jpg", type="image" },      message\_tags = mt }  

This does not work either.

I’ve done about 7 hours of researching before I submitted this post

And the only thing close to my question was this

http://forums.coronalabs.com/topic/35057-can-i-tag-someone-on-facebook-through-my-app/

except there is no promising answer.

Have you tried:

        local attachment = {             message = " ??????. ",             source = { baseDir=system.DocumentsDirectory, filename="picture.jpg", type="image" },             message\_tags =             {                  "id": "##########",                  "name": "Abc Def",                  "type": "user",                  "offset": 18,                  "length": 7            },         }         facebook.request( "me/photos", "POST", attachment )

Yup I have and I tried again when you asked.

The thing is, message_tags is an array of friend objects. And what I thought would work would be to do this

-- friends is a list of user object returned from showDialog where you can choose friends. mt = {} for i,v in pairs(friends) do     mt[i] =                         {id= v.id,                          name= v.fullName,                          type= "user",                          offset= i,                          length= 7} end local attachment  = {       message = " ??????. ",       source = { baseDir=system.DocumentsDirectory, filename="picture.jpg", type="image" },      message\_tags = mt }  

This does not work either.

I’ve done about 7 hours of researching before I submitted this post

And the only thing close to my question was this

http://forums.coronalabs.com/topic/35057-can-i-tag-someone-on-facebook-through-my-app/

except there is no promising answer.