Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Facebook event — Gideros Forum

Facebook event

edited September 2013 in General questions
Hi all,

I get trouble in using Facebook plugins. The problem will be explain in cases below:

1. In this case, the game ask for facebook permission right on start screen (or splash screen)
--on game.lua
if application:getDeviceInfo() == "Android" then
        require "facebook"
	facebook:addEventListener(Event.LOGIN_COMPLETE, function()
		print("login successful")
		facebook:extendAccessTokenIfNeeded()
	end)
        facebook:setAppId("624491254238494");
	facebook:authorize();
end
 
--after that, on share button click we check facebook:isSessionValid() then call facebook:dialog("feed", {})
2. In this case, when we click Share button, the game ask for facebook permission then crash, start the game and click again, facebook feed dialog appear.
--on share button click we call everything
local function onClick()
        require "facebook"
	facebook:addEventListener(Event.LOGIN_COMPLETE, function()
		print("login successful")
		facebook:extendAccessTokenIfNeeded()
	end)
        facebook:setAppId("624491254238494");
	facebook:authorize();
 
        if facebook:isSessionValid() then
               facebook:dialog("feed", {})
        end
end
=> I want: when we click Share button, if this is the first time, facebook ask for permission, then call feed dialog. Next time, only feed dialog appear.

What event I need to check when permission is granted, or facebook:authorize() is success?

Comments

Sign In or Register to comment.