sir a small question, I will send you my source code, so you can see the problem if you want, it’s here
first when i try to run your example it gives invalid token, is it because facebook login functionality is not supported on the simulator?
I noticed that all the work is done in menu,lua not main.lua in your github example, and that you use storyboard. I don’t use storyboard in my game,
can i create a file just for carrot? what i’m thinking is to load a facebook login image in my Screen_MainMenu.lua, when the user press on that image, he’ll be doing authentication in carrot.lua, to load
[lua]function scene:createScene( event )
local group = self.view
– create a widget button (which will loads level1.lua on release)
playBtn = widget.newButton{
label=“Test Event”,
labelColor = { default={255}, over={128} },
defaultFile=“button.png”,
overFile=“button-over.png”,
width=154, height=40,
onRelease = onPlayBtnRelease – event listener function
}
playBtn:setReferencePoint( display.CenterReferencePoint )
playBtn.x = display.contentWidth*0.5
playBtn.y = display.contentHeight - 125
– Carrot status text
local carrotStatusText = display.newText(“Carrot Status: UNKNOWN”, 0,0, nil, 14);
carrotStatusText:setReferencePoint(display.TopLeftReferencePoint);
carrotStatusText.x = 0;
– all display objects must be inserted into group
group:insert( playBtn )
group:insert( carrotStatusText )
– Carrot
carrot.init(fbAppID, carrotAppSecret)
carrot.setStatusCallback(function(status)
carrotStatusText.text = "Carrot Status: "…status
carrotStatusText:setReferencePoint(display.TopLeftReferencePoint);
carrotStatusText.x = 0;
end)
if system.getInfo(“environment”) == “device” then
facebook.login(fbAppID, function(event)
if event.type == “session” and event.phase == “login” then
carrot.validateUser(event.token)
end
end, {“publish_actions”})
else
local debugUserToken = “<< USER TOKEN FROM ACCESS TOKEN TOOL >>”
carrot.validateUser(debugUserToken)
end
end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local group = self.view
– INSERT code here (e.g. start timers, load audio, start listeners, etc.)
end
– Called when scene is about to move offscreen:
function scene:exitScene( event )
local group = self.view
– INSERT code here (e.g. stop timers, remove listenets, unload sounds, etc.)
end
– If scene’s view is removed, scene:destroyScene() will be called just prior to:
function scene:destroyScene( event )
local group = self.view
if playBtn then
playBtn:removeSelf() – widgets must be manually removed
playBtn = nil
end
end
[/lua]
and then when done i do
director:changeScene( “screen_MainMenu” )
would that work? any help is highly appreciated Sir