Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - facebook login dialog misbehaves and results in an error response if the dialog is launched in a different screen orientation than the app's screen orientation. #63

Open
msesen opened this issue Jul 29, 2024 · 0 comments

Comments

@msesen
Copy link

msesen commented Jul 29, 2024

  • Game is launched in landscape mode.
  • Screen rotation is locked on android device.
  • Upon clicking on the “Facebok login” button, the login dialog is launched in portrait mode.
  • If already logged in, Facebook informs you that you have previously logged into this app. Clicking on the Continue button closes the dialog and immidiately launches the dialog again. Clicking on the Continue button for the second time closes the dialog with an error {status = 0, error = “Aborted”}.

If I disable the screen rotration lock, then it works (if the device is held in landscape mode, otherwise the dialog will launch in portrait mode). The login dialog is launched in landscape mode, clicking on the Continue button returns to the app with the success payload of status = 200. HTML 5 build also works. But unfortunately, I need the game in landscape mode.

Could it be that the Activity that launches the dialog gets destroyed upon screen rotation?

Defold Editor 1.9.0, and the extension version is 9.0.0.

Here is a sample code.

`local function facebookLogin(self, data)

if data.status == facebook.STATE_OPEN then
    -- Logged in ok.

elseif data.status == facebook.STATE_CLOSED_LOGIN_FAILED then
    -- Do something to indicate that login failed

end

if data.error then
    -- .. something went wrong
end

end

local function onFacebookLoginBtnClick(self)
if not facebook then
-- Facebook login is not available for this device.
return
end

-- Login with read permissions.
local permissions = { "public_profile" }
facebook.login_with_permissions(permissions, facebook.AUDIENCE_EVERYONE, facebookLogin)

end`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant