facebook error

I just have a copy and paste of Ghosts VS Monsters facebook button in my game and this don’t work
anyone know why?

I have all what needs, require facebook and FBappID

someone can help me? [import]uid: 23063 topic_id: 10479 reply_id: 310479[/import]

Hey Dhennrich :slight_smile:

I could be mistaken but I am almost certain that Ghosts VS Monsters uses the old Facebook code.

Take a look at the latest tutorial for Facebook on Techority; it is confirmed working as of 4 days ago.

Peach :slight_smile: [import]uid: 52491 topic_id: 10479 reply_id: 38234[/import]

I have build ghosts vs monsters for iphone and run it and facebook button works fine
=S [import]uid: 23063 topic_id: 10479 reply_id: 38283[/import]

Hey,

I suppose I was mistaken then and it is the current code :wink:

If Facebook isn’t working for you but it is in that app then something is wrong with your code or the set up on the Facebook end.

All you can do is find the bug and squash it!

Peach :slight_smile: [import]uid: 52491 topic_id: 10479 reply_id: 38405[/import]

strange… because i copy and paste all the facebook’s functions and buttons =S [import]uid: 23063 topic_id: 10479 reply_id: 38408[/import]

Are you certain you have replaced the API Keys and that stuff in the code? [import]uid: 22737 topic_id: 10479 reply_id: 38423[/import]

yep… when i use facebookButton in ghosts vs mosters, he uses my fbID and post abouit my aplication… all works fine :S

i will take the code and show you, the code that i’m copy and paste [import]uid: 23063 topic_id: 10479 reply_id: 38427[/import]

 local facebook = require "facebook"  
  
-- FACEBOOK BUTTON  
 local onFBTouch = function( event )  
 if event.phase == "release" and fbBtn.isActive then  
 audio.play( tapSound )  
  
 -- 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 = "121532041261776" --\> (string) Your FB App ID from facebook developer's panel  
  
 local facebookListener = function( event )  
 if ( "session" == event.type ) then  
 -- upon successful login, update their status  
 if ( "login" == event.phase ) then  
  
 local scoreToPost = comma\_value(gameScore)  
  
 local statusUpdate = "just scored a " .. gameScore .. " on Halloween's Night!"  
  
 facebook.request( "me/feed", "POST", {  
 message=statusUpdate,  
 name="Download Halloween's Night to Compete with Me!",  
 caption="Halloween's Night by ZoMobile.",  
 link="http://itunes.apple.com/us/app/your-app-name/id382456881?mt=8",  
 picture="http://www.yoursite.com/link-to-90x90-image.png" } )  
 end  
 end  
 end  
  
 facebook.login( fbAppID, facebookListener, { "publish\_stream" } )  
  
 end  
 end  
  
 fbBtn = ui.newButton{  
 defaultSrc = "imagens/menu.png",  
 defaultX = 60,  
 defaultY = 60,  
 overSrc = "imagens/menu.png",  
 overX = 60,  
 overY = 60,  
 onEvent = onFBTouch,  
 id = "fbBtn",  
 text = "",  
 font = "Helvetica",  
 textColor = { 255, 255, 255, 255 },  
 size = 16,  
 emboss = false  
 }  
  
 fbBtn.x = 30; fbBtn.y = 30  
 fbBtn.isVisible = false  
 hudGroup:insert( fbBtn )  
  
 timer.performWithDelay( 200, function() fbBtn.isVisible = true; end, 1 )  
  

this is it? [import]uid: 23063 topic_id: 10479 reply_id: 38428[/import]

This is what I have and that works great. I just set an fbAPI in the top of the file to the application id of my application in Facebook.

[lua]function fbLogin()
facebook.login( fbAPI, fblistener, { “publish_stream”,“email” } )
loadScreen(“screen1”)
end
function fbLogout()
facebook.logout()
loadScreen(“screen1”)
end
– facebook post function
function facebookPost(theMessage,theName, theCaption, theLink)
facebook.request( “me/feed”, “POST”, {
message=theMessage,
name=theName,
caption=theCaption,
link=theLink } )
end[/lua]

First I have to use the login function and that needs to be called each time the app starts or just before you post a message otherwise the session is lost and no message will be posted. I always run this when the app starts IF THE USER HAVE activated Facebook connect in the app, otherwise I dont pop up the Facebook dialog until they activate the Facebook connect the first time.

Works like a charm for me on iPhone and Android. [import]uid: 22737 topic_id: 10479 reply_id: 38504[/import]

didnt work =T
can you post how you call the facebook button?
i mean… everthing about facebook in your code [import]uid: 23063 topic_id: 10479 reply_id: 38543[/import]