I have a landscape-oriented app that is having some problems in the latest public build (2381) with facebook.shareDialog()
The dialog shows up, however, it’s the portrait version of the dialog, rotated. It fit the screen properly in the last public build (2189). Now, it’s too tall and skinny. Attached is an image of the problem. I have also submitted a bug report.
Just wondering, have any of you encountered this problem?
Here’s a simple code demo to illustrate the problem.
Main.lua
local facebook = require("facebook") local json = require("json") local function fblistener( event ) print( "event.name", event.name ) --"fbconnect" print( "event.type:", event.type ) --type is either "session", "request", or "dialog" print( "isError: " .. tostring( event.isError ) ) print( "didComplete: " .. tostring( event.didComplete ) ) --"session" events cover various login/logout events --"request" events handle calls to various Graph API calls --"dialog" events are standard popup boxes that can be displayed if ( "session" == event.type ) then --options are: "login", "loginFailed", "loginCancelled", or "logout" print("event phase:", event.phase) if ( "login" == event.phase ) then local access\_token = event.token --code for tasks following a successful login facebook.showDialog('share\_open\_graph', {action\_type = "xxxxxxxxxxx", action\_properties = json.encode({score=tostring(123), level="blah"})}) end elseif ( "dialog" == event.type ) then print( "dialog", event.response ) if event.didComplete then print("dialog completed successfully!") end --handle dialog results here end end local function onFBLoginTouch(event) if event.phase == "began" then print("onTouch") facebook.login("xxxxxxxxxxxxxxxxxxx", fblistener) return true end end local fbShare = display.newText({ text = "share", font = native.systemFont, fontSize = 40, x = display.contentCenterX, y = display.contentCenterY, }) fbShare:addEventListener("touch", onFBLoginTouch)
build.settings
settings = { orientation = { default = "portrait", supported = { "portrait","landscapeRight", "landscapeLeft" } }, android = { usesPermissions = { "android.permission.INTERNET", }, }, plugins = { -- key is the name passed to Lua's 'require()' This section is only required for builds \> 2014.2165 ["facebook"] = { -- required publisherId = "com.coronalabs", supportedPlatforms = { iphone = true, ["iphone-sim"] = true }, }, }, iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, UIApplicationExitsOnSuspend = false, -- must be false for single sign-on to work FacebookAppID = "xxxxxxxxxxxxxxxxxx", -- replace XXXXXXXXX with your facebook appId CFBundleURLTypes = { { CFBundleURLSchemes = { "fbxxxxxxxxxxxxxxxx", -- replace XXXXXXXXX with your facebook appId } } } } } }
Edit: Bug Link: http://bugs.anscamobile.com/default.asp?34823