android - Posting savescreen to FB -


i need solve problem: want post on fb save screen app (i got save screen using display.save function). works fine on android while on ipad crashes! please find function code below:

local function postonfb( event)     display.save( tab3fields, { filename="ticket.jpg", basedir=system.documentsdirectory, isfullresolution=true, backgroundcolor={0, 0, 0, 0} } )      local fbappid = "4531113981xxxxx"       local function fblistener( event )         if event.phase == "login"             local attachment = {                 message="i champion!",                 source= {basedir=system.documentsdirectory, filename="ticket.jpg", type="image"}             }              facebook.request("me/photos", "post", attachment)             native.showalert("facebook", "submitted!")         end     end      -- photo uploading requires "publish_actions" permission     facebook.login( fbappid, fblistener, { "publish_actions" } ) end 

please help, getting crazy understand what's wrong! lot. ubaldo

here facebook sharing code:

basedir = system.documentsdirectory display.save( group , "screenshot.png", system.documentsdirectory )  local facebook = require "facebook" local fbappid = "898209xxxxxxxxx"   function onloginsuccess()     attachment = {     message = "i got ".. score .. " blablabla",     source = { basedir=system.documentsdirectory, filename="screenshot.png", type="image" }     }     facebook.request( "me/photos", "post", attachment ) end  function fblistener( event )     if event.iserror         native.showalert( "error", event.response, { "ok" } )     else         if event.type == "session" , event.phase == "login"             onloginsuccess()         elseif event.type == "request"             print("upload done")         end     end end facebook.login( fbappid, fblistener, { "publish_stream", "publish_actions" } ) 

ps have in build.settings?

plugins = {     ["facebook"] =     {         publisherid = "com.coronalabs"     },  },   

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -