happy to pass MIME data if we know the format up front. or a binary file read or whatever, i’m just not sure the parameter is implemented in the facebook module.
just to clarify, we would want to be able to create raw data from either a display object/group (eg from a screen capture), or a file and then pass this to the graph api “source” parameter of the “me/photos” request. corona would presumably need to detect the filetype from the extension to add the relevant content type
since presumably io.open & read can be used for getting the data of an image file, and a display group can be saved and loaded from a temporary screencapture, getting the raw image data isnt specifically an issue. it’s just getting the data and it’s content type into the facebook request
this would theoretically work for video uploads too
+1 this would be quite useful - right now we only seem to be able to post standard wall posts, but being able to actually add a photo to the user’s FB photo library would be a great tool. [import]uid: 27636 topic_id: 8179 reply_id: 29675[/import]
i have put a suggested functionality up on the subscribers feature/bug forum… but for your info
this is one way I would hope it might work (it doesn’t currently)
[lua]local path = system.pathForFile( “image.jpg” )
local imgfile = io.open( path, “rb” )
local imgData = ltn12.source.file(imgfile)
local args= {
message=“hello”,
source = imgData
}
facebook.request(“me/photos”, “POST”, args)[/lua]
it would also be useful to have a binary encoder for a display group (without saving to file) but I think saving to a temporary directory and reloading is a sufficient workaround
I’m not sure if Facebook required a specific content-type header (eg image/jpeg, image/png etc so this is also something that would need to be implemented if so)
[import]uid: 6645 topic_id: 8179 reply_id: 29677[/import]
NOTE: The tutorial includes important information regarding build.settings for any iOS app using the Facebook API in build 2011.707 and later, regardless if you intend to upload photos or not. [import]uid: 52430 topic_id: 8179 reply_id: 74245[/import]