Hey guys,
I have a little problem that i seem to cannot fix, i am not sure if it is a corona bug of its my code that is causing to encounter this problem. Here is the problem.
I am trying to set up my app to give the user the option to invite friends from Facebook to download the application. But every time i call facebook.showDialog( ) and pass in “feed” or “apprequests” my application crashes. So pulled out my adb and did a log cat with the corona sdk filter and the a raw logcat with out the filter. And i did not find an error. Before i saw anything else, my app authenticate with facebook properly. I am not sure if because i am asking for “publish_actions” permission alone, the corona sdk docs did not say much about a specific permission for this functionality. here is my code below
Log = loadTable ("Logs.txt") KeyLoger = Log["Logs"] local dealta = KeyLoger function facebookSaver ( event ) Log["Logs"] = dealta saveTable (Log,"Logs.txt") end function Fblogin ( event) print "login" ---mean the user is loged in to facebook carrot.init ("xxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxx") facebook.login( "xxxxxxxxxxxxxxxxxxx", function (event) if event.type == "session" and "login" then print "user have log in successfully" carrot.validateUser(event.token) transition.to( text02, {time = 1000, alpha = 1, onComplete = setback} ) else if event.isError then print "fail" transition.to( text04, {time = 1000, alpha = 1, onComplete = setback03} ) end end end, {"publish\_actions"})--- my permission !!!!!!!!!! end function Facebook ( event ) phase = event.phase if "ended" == phase and dealta == false and environment == "simulator" then audio.play( soundFile2,{channel = 1} ) --system.openURL( "wwww.facebook.com" ) Fblogin(); dealta = true facebookSaver(); transition.to( text02, {time = 1000, alpha = 1, onComplete = setback} ) FB:setEnabled( false ) else if "ended" == phase and dealta == false then ---FB:setEnabled( false ) audio.play( soundFile2,{channel = 1} ) --system.openURL( "wwww.facebook.com" ) Fblogin(); dealta = true facebookSaver(); else if "ended" == phase and dealta == true and environment == "simulator" then audio.play( soundFile2,{channel = 1} ) --system.openURL( "https://www.facebook.com/boxingstudiogames" ) --facebook.showDialog( "friends", showInvite ) FB:setEnabled( false ) showInvite () else if "ended" == phase and dealta == true then audio.play( soundFile2,{channel = 1} ) --FB:setEnabled( false ) facebook.showDialog( "apprequests" ) --- the line i think is causing the problem end end end end end
Also ,i read online that past corona sdk builds had this problem here is my current version 2014.2189 (2014.3.6)
Another thing, when i pass in “friends” with a call back function my app works fine. But i want to pass in freed or apprequest to invite fb users to my game.
Can someone please help me solve this problem or shine some light on what is going on here Thanks!
Sean