Facebook Score Posts Not Working

Hello, I’ve noticed that my “post score to Facebook” is not working on my Android device anymore. Any ideas of why this has stopped working?

this code was valid, has something changed?

here’s the code:

 -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* --  
  
 -- connectHandler (for facebook posting)  
  
 -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* --  
  
 local function connectHandler( event )  
 local post = "Playing App!"  
 local gameScore = getScore()  
 gameScore = comma\_value(gameScore)  
  
 local session = event.sender  
 if ( session:isLoggedIn() ) then  
  
 print( "fbStatus " .. session.sessionKey )  
  
 local scoreStatusMessage = "just scored a " .. tostring(gameScore) .. " on App."  
  
 local attachment = {  
 name="Download App To Compete With Me",  
 caption="Think you can beat my score of " .. tostring(gameScore) .. "? I dare you to try!",  
 href="https://market.android.com/details?id=",  
 media= { { type="image", src="http://www.server.com/Icon\_90.png", href="https://market.android.com/details?id=" } }  
 }  
  
 local action\_links = {  
 { text="Download App", href="https://market.android.com/details?id=" }  
 }  
  
 local response = session:call{  
 message = scoreStatusMessage,  
 method ="stream.publish",  
 attachment = json.encode(attachment),  
 action\_links = json.encode(action\_links),  
 }  
  
 if "table" == type(response ) then  
 -- print contents of response upon failure  
 printTable( response, "fbStatus response:", 5 )  
 end  
  
 local onComplete = function ( event )  
 if "clicked" == event.action then  
 local i = event.index  
 if 1 == i then  
 -- Player click 'Ok'; do nothing, just exit the dialog  
 end  
 end  
 end  
  
 -- Show alert with two buttons  
 local alert = native.showAlert( "App", "Your score has been posted to Facebook.",   
 { "Ok" }, onComplete )  
 end  
 end  

Thanks,

Dylan [import]uid: 98618 topic_id: 23474 reply_id: 323474[/import]

what build are you using? Try using Build 704 [import]uid: 17058 topic_id: 23474 reply_id: 94240[/import]

That was the issue. I should have known better than to use a daily build with Facebook API functionality. Doh! [import]uid: 98618 topic_id: 23474 reply_id: 94336[/import]

Hey guys - Like sebitttas said 704 still supports older FB method.

For newer builds you CAN make it work but need to use new system. Take a look at sample code folder in newer builds, go Networking > Facebook and check that out.

That example works fine in latest builds provided you remember to put your App ID in main.lua and build.settings.

Peach :slight_smile: [import]uid: 52491 topic_id: 23474 reply_id: 94402[/import]

Anybody get the new scores posting working?

https://developers.facebook.com/docs/score/

The format is like so:

You can post a score or a user by issuing an HTTP POST request to /USER_ID/scores with the app access_token

I have tried with Graph explorer as well… is the token Corona grabs the APP access token? Apparently this is somewhat different from the regular access token. [import]uid: 107466 topic_id: 23474 reply_id: 119448[/import]

Hi, Peach:

I try the sample codes come with the SDK build 870. The facebook sample can not work on my Samsung Galaxy Note which is running android 4.0.4. Can you find out if that is true.

Bob [import]uid: 20999 topic_id: 23474 reply_id: 119572[/import]

This is what I got in log cat.
I/Corona ( 6818): Facebook Listener events:
I/Corona ( 6818): type(session)
I/Corona ( 6818): name(fbconnect)
I/Corona ( 6818): phase(logout)
I/Corona ( 6818): isError(false)
I/Corona ( 6818): response()
I/Corona ( 6818): event.name
I/Corona ( 6818): fbconnect
I/Corona ( 6818): event.type:
I/Corona ( 6818): session
I/Corona ( 6818): isError: false
I/Corona ( 6818): didComplete: nil
I/Corona ( 6818): Session Status: logout
I/SurfaceFlinger( 1691): id=827 Removed CoronaActivity idx=3 Map Size=6
I/SurfaceFlinger( 1691): id=827 Removed CoronaActivity idx=-2 Map Size=6
I/SurfaceFlinger( 1691): id=831(8) createSurface 0x2bf4c (800x1280),1 flag=0, CoronaActivity
I/Corona ( 6818): Facebook Listener events:
I/Corona ( 6818): type(session)
I/Corona ( 6818): name(fbconnect)
I/Corona ( 6818): phase(loginFailed)
I/Corona ( 6818): isError(true)
I/Corona ( 6818): response(invalid_key:Android … #214)
I/Corona ( 6818): event.name
I/Corona ( 6818): fbconnect
I/Corona ( 6818): event.type:
I/Corona ( 6818): session
I/Corona ( 6818): isError: true
I/Corona ( 6818): didComplete: nil
I/Corona ( 6818): Session Status: loginFailed
[import]uid: 20999 topic_id: 23474 reply_id: 119596[/import]

Hey Bobyeh, you’d want to post that in the Android sub forum, I’m afraid I don’t work with FB on Android. That said one thing always worth double checking is hash, there’s a thread on that where several people had issues there just by forgetting to include it, etc. [import]uid: 52491 topic_id: 23474 reply_id: 119622[/import]

Hi, Peach:

Thank you for your reply. Is there a Corona Link for how to get the “Android Key Hash”?

BOB [import]uid: 20999 topic_id: 23474 reply_id: 119734[/import]

Hey Bob - this thread is about an error but it’s short and if you read it you will see it covers getting hash key, signing correctly, etc; http://developer.coronalabs.com/forum/2012/03/20/facebook-and-android-key-hash

Peach :slight_smile: [import]uid: 52491 topic_id: 23474 reply_id: 119828[/import]

Hi, Peach:

Very helpful. Thank you very much.

BOB [import]uid: 20999 topic_id: 23474 reply_id: 120045[/import]

Hi, Peach:

I try the sample codes come with the SDK build 870. The facebook sample can not work on my Samsung Galaxy Note which is running android 4.0.4. Can you find out if that is true.

Bob [import]uid: 20999 topic_id: 23474 reply_id: 119572[/import]

This is what I got in log cat.
I/Corona ( 6818): Facebook Listener events:
I/Corona ( 6818): type(session)
I/Corona ( 6818): name(fbconnect)
I/Corona ( 6818): phase(logout)
I/Corona ( 6818): isError(false)
I/Corona ( 6818): response()
I/Corona ( 6818): event.name
I/Corona ( 6818): fbconnect
I/Corona ( 6818): event.type:
I/Corona ( 6818): session
I/Corona ( 6818): isError: false
I/Corona ( 6818): didComplete: nil
I/Corona ( 6818): Session Status: logout
I/SurfaceFlinger( 1691): id=827 Removed CoronaActivity idx=3 Map Size=6
I/SurfaceFlinger( 1691): id=827 Removed CoronaActivity idx=-2 Map Size=6
I/SurfaceFlinger( 1691): id=831(8) createSurface 0x2bf4c (800x1280),1 flag=0, CoronaActivity
I/Corona ( 6818): Facebook Listener events:
I/Corona ( 6818): type(session)
I/Corona ( 6818): name(fbconnect)
I/Corona ( 6818): phase(loginFailed)
I/Corona ( 6818): isError(true)
I/Corona ( 6818): response(invalid_key:Android … #214)
I/Corona ( 6818): event.name
I/Corona ( 6818): fbconnect
I/Corona ( 6818): event.type:
I/Corona ( 6818): session
I/Corona ( 6818): isError: true
I/Corona ( 6818): didComplete: nil
I/Corona ( 6818): Session Status: loginFailed
[import]uid: 20999 topic_id: 23474 reply_id: 119596[/import]

Hey Bobyeh, you’d want to post that in the Android sub forum, I’m afraid I don’t work with FB on Android. That said one thing always worth double checking is hash, there’s a thread on that where several people had issues there just by forgetting to include it, etc. [import]uid: 52491 topic_id: 23474 reply_id: 119622[/import]

Hi, Peach:

Thank you for your reply. Is there a Corona Link for how to get the “Android Key Hash”?

BOB [import]uid: 20999 topic_id: 23474 reply_id: 119734[/import]

Hey Bob - this thread is about an error but it’s short and if you read it you will see it covers getting hash key, signing correctly, etc; http://developer.coronalabs.com/forum/2012/03/20/facebook-and-android-key-hash

Peach :slight_smile: [import]uid: 52491 topic_id: 23474 reply_id: 119828[/import]

Hi, Peach:

Very helpful. Thank you very much.

BOB [import]uid: 20999 topic_id: 23474 reply_id: 120045[/import]