Facebook Post To Wall NOT WORKING ON ANDROID DEVICE!

Hello Fellow Corona Developers,

I know this has been an issue for a while (hit and miss), but I am having this issue where I need to post a message to facebook wall. The problem is that every time I install into my android device, it shows a login status circle and it fades out to my previous screen and never posts to facebook wall. I have tested this it on my Kindle Fire, and I am able to post on facebook wall, but on my android phone NO LUCK!

The worst part is that I have another small game I developed and I used the same code for posting on facebook, and it works perfectly everytime, but when in my new game (the one I am working on) it doesn’t work.

Help, please.

Thanks in advance [import]uid: 75258 topic_id: 20741 reply_id: 320741[/import]

I just tested Facebook posting on an Android device and it worked fine.

It would be worth checking your internet connection and reviewing your code to make sure you are using the most recent Facebook code.

Peach :slight_smile: [import]uid: 52491 topic_id: 20741 reply_id: 81646[/import]

Thanks Peach! I will check again see if I made some stupid mistakes (that has happened before!)

Thank you very much!

Paulo [import]uid: 75258 topic_id: 20741 reply_id: 81786[/import]

What version of Corona are you using?

If you can’t get it to work let me know, I’ll see if I can pinch an Android device to test on again.

Peach :slight_smile: [import]uid: 52491 topic_id: 20741 reply_id: 81811[/import]

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]

This may be an issue since single sign in was implemented although I’d have to look into that.

Are you able to revert to the last stable build (704) to build and test this and let me know results? [import]uid: 52491 topic_id: 20741 reply_id: 82128[/import]

I have the same issue when using build 762 & 767. But it work well on stable build (704).
I hope it fixed soon… [import]uid: 102087 topic_id: 20741 reply_id: 94370[/import]

Have you used keytool to get a hash key from your keystore, and pasted that into your app info in facebook?

http://stackoverflow.com/questions/4347924/key-hash-for-facebook-android-sdk

You’ll need to do that for your debug keystore while testing and again for your app’s keystore for your final build. [import]uid: 93133 topic_id: 20741 reply_id: 94386[/import]

I am using build 773 with this code:

[lua]function fbListener(event)
– this handles the posting to facebook once the login command is sent
if event.type == “session” then
if event.phase == “login” then
postMsg = {
message = “I just scored “…tostring(PLAYERDATA.SCORE)…
" in Spell Them Out!”,
name = “Spell Them Out”,
link = “http://www.gamesbycandlelight.com”,
caption = “Spell Them Out by Games By Candlelight”,
picture = “http://www.facebook.com/photo.php?"
“fbid=323504717702700&set=a.323504707702701.83294.307706399282532&type=1&ref=nf”,
description = “Spell words to remove tiles, causing diamonds to drop.\n”…
“Select letters to spell words. Words can be spelled out of order,”…
" but more points are awarded if you spell them in correct letter order.\n”…
" Spelling a word removes the tiles, which causes the diamonds to drop. \n”…
“Drop all diamonds to advance to next level.”
}
facebook.request(“me/feed”, “POST”, postMsg)
else
local alert = native.showAlert(“Login Error”,
“Error logging into Facebook”,
{ “OK” })
end

return
end

– this handles the message received after a POST command
if event.type == “request” then
if event.isError then
local alert = native.showAlert(“Message Not Posted”,
“Sorry, there was a problem posting to Facebook”,
{ “OK” })
else
local alert = native.showAlert(“Message Posted”,
“High score posted to Facebook”,
{ “OK” })
end
end
end

function onComplete(event)
if event.action == “clicked” then
if event.index == 2 then
facebook.login(MY_FACEBOOK_APPID, fbListener,{“publish_stream”})
end
end
end

local alert = native.showAlert(“Personal Best!”,
“Congratulations! You beat your personal high score in this game!”,
{ “OK”, “Post to Facebook” }, onComplete)[/lua]

I get a “High Score posted to Facebook”, but I never see it on my wall. Am i doing something wrong? Testing on Android. [import]uid: 114363 topic_id: 20741 reply_id: 96688[/import]

Sorry for the bump, but does anyone have any ideas? [import]uid: 114363 topic_id: 20741 reply_id: 97125[/import]

I am having the same issue with the latest daily build and facebook. works fine with the stable build. Also keyhash and all the good stuff is setup and all programming is correct, i assume its a problem with the daily builds. [import]uid: 126161 topic_id: 20741 reply_id: 97225[/import]

Can either of you tell me if you are getting this issue using the facebook sample code that comes in the CoronaSDK folder? (With your ID replaced in main.lua and build.settings, of course.) [import]uid: 52491 topic_id: 20741 reply_id: 97251[/import]

@Peach
I tested it with the sample facebook code that comes with corona and i am having the same problem still. Also, i noticed you said build.setting, from what i have read this problem seems to only effect android.
here is the code i am using in my game.
[lua] --Facebook function
local faceListener = function (event)
if event.type == “session” then
if event.phase == “login” then
facebook.request( “me/feed”, “POST”, {message = “Hello Facebook”} )
end
end
end

facebook.login(myAppID, faceListener, {“publish_stream”} )[/lua] [import]uid: 126161 topic_id: 20741 reply_id: 97280[/import]

We have the same issue since yesterday (iOS). We tested the facebook sample code with 2012.775 and 2011.704a (same behaviour).

GET_USER_INFO and SHOW_DIALOG -> OK (btw, it would be great if we could prepopulate the dialog)
POST_PHOTO and POST_MSG -> NOT OK

The event.response contains facebookErrDomain error 10000 [import]uid: 10637 topic_id: 20741 reply_id: 97299[/import]

@Peach

I changed the facebook user and now the facebook sample application and our game work fine. But it still doesn’t work with my original facebook account. Any ideas? [import]uid: 10637 topic_id: 20741 reply_id: 97328[/import]

Everyone,

I just tested our sample app “Networking/Facebook” with build 776 on my Samsung Galaxy S2… and it worked. I was able to post messages, photos, and fetch user information just fine. I tried it with and without the Facebook app install on the Android device, which has different log on behavior and both worked. [import]uid: 32256 topic_id: 20741 reply_id: 98057[/import]

I’m still not getting it to work, even with 776.

I do not get an event.isError returned with any errors, so I am a bit perplexed. [import]uid: 114363 topic_id: 20741 reply_id: 98131[/import]

I am still getting the same error, with build 776. I am testing on an evo 4g if that makes any difference, also i am using the facebook app. I’m gonna try to regenerate the hash and maybe remake the developer account and see if that does anything [import]uid: 126161 topic_id: 20741 reply_id: 98202[/import]

Everyone,

Please be aware that the IDs that you provide to the facebook login will be different on Android than it will be on iOS. The most common mistake that I see people make is that they generate the signature wrong for their app’s keystore. If the signature that you provide to facebook does not match what your app was signed with using your keystore, then your app will fail to log in to facebook.

The official facebook instructions on how to generate this signature can be found here…
http://developers.facebook.com/docs/mobile/android/build/#sig

Please see the section where it tells you how to generate this signature via the “keytool” at the command line. Also make sure to do this with the same keystore that you sign your app with.

I hope this helps! [import]uid: 32256 topic_id: 20741 reply_id: 98364[/import]

As 3 Dreams Games said (#10), I have same issue on iOS 5.1. I changed Build: 2011.704 to Build: 2012.777. My app facebook posting wall function is OK on the stable build(704). But it doesn’t work on the latest build(777). The original facebook app or safari launched instead of facebook webui. How can I fix it ?
[import]uid: 79009 topic_id: 20741 reply_id: 98992[/import]