Hello Peach!
I am running 722 build. I have tried again and did not work . Here’s the code I am using:
[code]
– FACEBOOK BUTTON
local onFBTouch = function( event )
playTapSound()
if event.phase == “release” and share_facebook.isActive then
– local fadeMenuButtonTimer = timer.performWithDelay ( 1200, function() main_menu.isVisible = true; main_menu.alpha = 0.9; end , 1 )
– Code to Post Status to Facebook (don’t forget the ‘require “facebook”’ line at top of module)
– The Code below is fully functional as long as you replace the fbAppID var with valid app ID.
local fbAppID = “XXXXXXXXXX”
local facebookListener = function( event )
if ( “session” == event.type ) then
– upon successful login, update their status
if ( “login” == event.phase ) then
scoreToPost = comma_value(roundFinaleScore)
–scoreLala = “12344”
–local statusUpdate = “just scored a " … gameScore … " on Ghosts v.s Monsters!”
local statusUpdate = " Just scored a " … scoreToPost … " on FruitCatcher game!!"
facebook.request( “me/feed”, “POST”, {
message=statusUpdate,
name=“Get FruitCatcher game and catch lots of fruit!!”,
caption=“FruitCatcher - catch all fruit you can eat, avoiding catching bugs. A mobile game developed by magadistudio.”,
–link=“http://www.amazon.com/gp/mas/dl/android?p=com.magadistudio_pdichone_smgame_2011.com”,
link = “http://store-locator.barnesandnoble.com/storelocator/stores.aspx?x=y&”, – B&N for now, until we get the correct link to the app
–link=“http://www.amazon.com/magadistudio-Fruit-Catcher/dp/B00702LLQI/ref=sr_1_1?ie=UTF8&s=mobile-apps&qid=1327140824&sr=1-1”, --for amazon android phone
–http://www.amazon.com/magadistudio-Fruit-Catcher/dp/B00702LLQI/ref=sr_1_1?ie=UTF8&s=mobile-apps&qid=1327140824&sr=1-1
–link=“https://market.android.com/details?id=com.magadistudio_pdichone_smgame_2011.com&feature=search_result”, – change this to reflect android market, amazon appstore or itunes
picture=“http://pdichone.magadistudio.com/wp-content/uploads/2012/01/Icon-hdpi.png” } )
end
end
end
facebook.login( fbAppID, facebookListener, { “publish_stream” } )
–[[ if event.isError then
– it didn’t get posted
timer.performWithDelay( 500, function() local alert = native.showAlert( “Facebook Error”, “Your stats did not get posted on your Wall. Please try again later.”, { “OK” } ); end )
else
– posted successfully
timer.performWithDelay( 500, function() local alert = native.showAlert( “Posted to Facebook”, “Your stats have been posted on your Wall.”, { “OK” } ); end )
– has it been more than 4 hours since they posted last?
if os.difftime( os.time(), lastFBRewardTime ) >= 14400 then
lastFBRewardTime = os.time()
– reward user with some sort of bonus here
end
end–]]
– wait a few seconds then show the popup screen telling the users that their score was sent to facebook wall successfully
local showSentNotification = timer.performWithDelay(700, showNotification() , 1)
end
end
[/code] [import]uid: 75258 topic_id: 20741 reply_id: 81910[/import]