Facebook: App Center

If you want to stay with the Graphics 1.0 engine, you should get 1260 and it has fixes that address this for Facebook.  If you can move to the Graphics 2.0 engine, any version of that should have the fixes for Facebook.

For most people adding:   graphicsCompatibility = 1 to your config.lua will take care of most of the G2.0 changes if you don’t want to convert to the G2.0 way of life :slight_smile:

Rob

Hi Rob,

That’s great! Yeah, the new one breaks my game, even with compatibility mode turned on…where can i access 1260? I cant seem to find it anywhere!

Thanks,

Alan.

http://developer.coronalabs.com/downloads/daily-builds/

I don’t have a subscription, so cant access daily build…I’ve half migrated to 2.0, but I now I’m caught by a scroll view returning nil bug.

Could you tell me when the next public release is scheduled? My game is due for release in 2 weeks…

Or do you know of any workaround? Perhaps, if I time the calls to the listener to get whether it is moving or not?

Alan.

Nevermind, kind of hacked a fix by doing this (for anyone else who is interested):

local isBegan = true local scrollTimer -- ScrollView listener local function scrollListener( event ) if(scrollTimer~=nil)then timer.cancel(scrollTimer) end if(isBegan==true)then print("Phase Began") isBegan = false end local function phaseEnded() print("Phase Ended") isBegan = true end print("Phase Moved") scrollTimer=timer.performWithDelay(100,phaseEnded,1) end

Hi Rob,

Facebook is still giving me the same error, and is not validating the app with 2013.2076:
 

Your iOS app must use the native Login dialog that comes with Facebook’s SDKs instead of custom web views. Ensure you have successfully tested your Facebook Login integration for Single Sign On or remove this integration as a listed platform in the developer app. See more details here

 

Has this issue been fixed?

 

Thanks,

Alan.

There have been some changes to our Facebook API calls since 2076 came out.  We just released a new updated public build today, 2100.  Please download it and see if you are still having the issue.  This fixes a bunch of things, so it’s really best to move to the new public build as soon as you can.

Rob

I’m having the same issue where after logout, log back in, I get this error.

I’m using 1260 build.

It all works perfect on android, it’s just the iOS version that crashes.

Could I get more info on this?

Edit: I found out that it works on 1202 build.

Interesting thing I noted that was different from 1260 build and 1202 build was that when I do

  1. login

  2. logout

  3. login

after third step, build 1260 would try to pull everything without jumping to and back from facebook app.

It pulls the data and displays it, but after that, it spits out the said error message and freezes.

1202 does the jumping and it works perfectly.

Hopefully this is not an issue with the graphics 2.0 builds as I will be building my new app on it. :stuck_out_tongue:

Also, I hope this helped someone not spend 10 hours and stay up until 730 am like I just did.

Cheers,

did anyone ever figure this out?

Normal Facebook posts work fine, but when asking for user_photos permission I get this message from facebook. 

"

iPhone

Your app cannot embed the Facebook Login dialog inside a custom web view. Utilize our native Facebook Login SDK, so that users do not need to login twice. "

 

I am just using the standard Facebook integration with Corona, not the social plugin. 

 

Help!

@beesh, it sounds like you may not be setup to use the native facebook app to handle your login.   Please make sure to read:

http://docs.coronalabs.com/guide/social/setupFacebook/index.html

http://docs.coronalabs.com/guide/social/implementFacebook/index.html

http://coronalabs.com/blog/2013/07/30/understanding-facebook-authentication/

Rob

@Rob I have done everything I can see in those instructions. 

I have the facebook app created with both SSO and Deep Linking Enabled. 

I have updated the appID in both build.settings plus with the the .lua executing the code. 

From what I see I am copy/pasting your guys exact code more or less. 

I am deploying it on one of my iOS devices. I have the Facebook app installed on that iOS device. 

Every time I go to post to facebook it pulls up the nativeWebView and not the Facebook App for login. 

I upgraded to the most recent public build today as well (2393) just to be sure. 

HELP this is holding me up big time and I have a deadline in a few weeks for this project and I cannot submit this to facebook w/o it getting rejected. 

Please let me know what I am doing wrong. Thanks

main.lua

local widget = require( "widget" ) local facebook = require("facebook") local json = require("json") -- Facebook Commands local fbCommand -- forward reference local LOGOUT = 1 local SHOW\_DIALOG = 2 local POST\_MSG = 3 local POST\_PHOTO = 4 local GET\_USER\_INFO = 5 local GET\_PLATFORM\_INFO = 6 local function handleButtonEvent2( event ) if ( "ended" == event.phase ) then local function listener( event ) --- Debug Event parameters printout -------------------------------------------------- --- Prints Events received up to 20 characters. Prints "..." and total count if longer --- print( "Facebook Listener events:" ) local maxStr = 20 -- set maximum string length local endStr for k,v in pairs( event ) do local valueString = tostring(v) if string.len(valueString) \> maxStr then endStr = " ... #" .. tostring(string.len(valueString)) .. ")" else endStr = ")" end print( " " .. tostring( k ) .. "(" .. tostring( string.sub(valueString, 1, maxStr ) ) .. endStr ) end --- End of debug Event routine ------------------------------------------------------- print( "event.name", event.name ) -- "fbconnect" print( "event.type:", event.type ) -- type is either "session" or "request" or "dialog" print( "isError: " .. tostring( event.isError ) ) print( "didComplete: " .. tostring( event.didComplete) ) ----------------------------------------------------------------------------------------- -- After a successful login event, send the FB command -- Note: If the app is already logged in, we will still get a "login" phase -- if ( "session" == event.type ) then -- event.phase is one of: "login", "loginFailed", "loginCancelled", "logout" print(event.phase) -- tjn Added print( "Session Status: " .. event.phase ) if event.phase ~= "login" then -- Exit if login error return end -- The following displays a Facebook dialog box for posting to your Facebook Wall if fbCommand == SHOW\_DIALOG then -- "feed" is the standard "post status message" dialog facebook.showDialog( "feed", { name = "Test name", description = "Example description.", link = "http://www.coronasdk.com/" }) -- for "apprequests", message is required; other options are supported --[[facebook.showDialog( "apprequests", { message = "Example message." }) --]] end -- Request the Platform information (FB information) if fbCommand == GET\_PLATFORM\_INFO then facebook.request( "platform" ) -- \*\*tjn Displays info about Facebook platform end -- Request the current logged in user's info if fbCommand == GET\_USER\_INFO then facebook.request( "me" ) -- facebook.request( "me/friends" ) -- Alternate request end -- This code posts a photo image to your Facebook Wall -- if fbCommand == POST\_PHOTO then --[[local attachment = { message="KawaiiDressUp Creation!", source= {baseDir=system.DocumentsDirectory, filename="Icon.png", type="image"} }]]-- local attachment = { name = "I did GOOD!", link = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png", caption = "do good today @ goodfluence.com", description = "test", picture = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png", --picture = "Icon.png", actions = json.encode( { { name = "Learn More", link = "http://goodfluence.com" } } ) } facebook.request( "me/feed", "POST", attachment ) -- posting the photo end -- This code posts a message to your Facebook Wall if fbCommand == POST\_MSG then local time = os.date("\*t") local postMsg = { message = "Test Post For Goodfluence! " .. os.date("%A, %B %e") .. ", " .. time.hour .. ":" .. time.min .. "." .. time.sec } facebook.request( "me/feed", "POST", postMsg ) -- posting the message end ----------------------------------------------------------------------------------------- elseif ( "request" == event.type ) then -- event.response is a JSON object from the FB server local response = event.response if ( not event.isError ) then response = json.decode( event.response ) if fbCommand == GET\_USER\_INFO then statusMessage.textObject.text = response.name printTable( response, "User Info", 3 ) print( "name", response.name ) elseif fbCommand == POST\_PHOTO then --printTable( response, "photo", 3 ) print("Photo Posted") -- local alert = native.showAlert( "Daily Do Good", "Your Post has been successfully submited", { "Done", "Post To Twitter"}, onComplete5) elseif fbCommand == POST\_MSG then printTable( response, "message", 3 ) statusMessage.textObject.text = "Message Posted" else -- Unknown command response print( "Unknown command response" ) statusMessage.textObject.text = "Unknown ?" end else -- Post Failed statusMessage.textObject.text = "Post failed" printTable( event.response, "Post Failed Response", 3 ) end elseif ( "dialog" == event.type ) then -- showDialog response -- print( "dialog response:", event.response ) statusMessage.textObject.text = event.response end end local appId = "xxxx" local apiKey = nil -- Not needed at this time function postPhoto\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = POST\_PHOTO facebook.login( appId, listener, {"publish\_actions"} ) end local function getInfo\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = GET\_USER\_INFO facebook.login( appId, listener, {"publish\_actions"} ) end local function postMsg\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = POST\_MSG facebook.login( appId, listener, {"publish\_actions"} ) end local function showDialog\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = SHOW\_DIALOG facebook.login( appId, listener, {"publish\_actions"} ) end postPhoto\_onRelease() print( "Button was pressed and released" ) end end local facebookButton = widget.newButton { left = 100, top = 100, id = "button2", label = "Facebook", onEvent = handleButtonEvent2 }

build.settings

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, 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 = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay, FacebookAppID = "xxxxx", UIApplicationExitsOnSuspend = false, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbxxxxx", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }

I am an idiot. I was commenting out the iOS bundle schemes. I think that fixed it!

did anyone ever figure this out?

Normal Facebook posts work fine, but when asking for user_photos permission I get this message from facebook. 

"

iPhone

Your app cannot embed the Facebook Login dialog inside a custom web view. Utilize our native Facebook Login SDK, so that users do not need to login twice. "

 

I am just using the standard Facebook integration with Corona, not the social plugin. 

 

Help!

@beesh, it sounds like you may not be setup to use the native facebook app to handle your login.   Please make sure to read:

http://docs.coronalabs.com/guide/social/setupFacebook/index.html

http://docs.coronalabs.com/guide/social/implementFacebook/index.html

http://coronalabs.com/blog/2013/07/30/understanding-facebook-authentication/

Rob

@Rob I have done everything I can see in those instructions. 

I have the facebook app created with both SSO and Deep Linking Enabled. 

I have updated the appID in both build.settings plus with the the .lua executing the code. 

From what I see I am copy/pasting your guys exact code more or less. 

I am deploying it on one of my iOS devices. I have the Facebook app installed on that iOS device. 

Every time I go to post to facebook it pulls up the nativeWebView and not the Facebook App for login. 

I upgraded to the most recent public build today as well (2393) just to be sure. 

HELP this is holding me up big time and I have a deadline in a few weeks for this project and I cannot submit this to facebook w/o it getting rejected. 

Please let me know what I am doing wrong. Thanks

main.lua

local widget = require( "widget" ) local facebook = require("facebook") local json = require("json") -- Facebook Commands local fbCommand -- forward reference local LOGOUT = 1 local SHOW\_DIALOG = 2 local POST\_MSG = 3 local POST\_PHOTO = 4 local GET\_USER\_INFO = 5 local GET\_PLATFORM\_INFO = 6 local function handleButtonEvent2( event ) if ( "ended" == event.phase ) then local function listener( event ) --- Debug Event parameters printout -------------------------------------------------- --- Prints Events received up to 20 characters. Prints "..." and total count if longer --- print( "Facebook Listener events:" ) local maxStr = 20 -- set maximum string length local endStr for k,v in pairs( event ) do local valueString = tostring(v) if string.len(valueString) \> maxStr then endStr = " ... #" .. tostring(string.len(valueString)) .. ")" else endStr = ")" end print( " " .. tostring( k ) .. "(" .. tostring( string.sub(valueString, 1, maxStr ) ) .. endStr ) end --- End of debug Event routine ------------------------------------------------------- print( "event.name", event.name ) -- "fbconnect" print( "event.type:", event.type ) -- type is either "session" or "request" or "dialog" print( "isError: " .. tostring( event.isError ) ) print( "didComplete: " .. tostring( event.didComplete) ) ----------------------------------------------------------------------------------------- -- After a successful login event, send the FB command -- Note: If the app is already logged in, we will still get a "login" phase -- if ( "session" == event.type ) then -- event.phase is one of: "login", "loginFailed", "loginCancelled", "logout" print(event.phase) -- tjn Added print( "Session Status: " .. event.phase ) if event.phase ~= "login" then -- Exit if login error return end -- The following displays a Facebook dialog box for posting to your Facebook Wall if fbCommand == SHOW\_DIALOG then -- "feed" is the standard "post status message" dialog facebook.showDialog( "feed", { name = "Test name", description = "Example description.", link = "http://www.coronasdk.com/" }) -- for "apprequests", message is required; other options are supported --[[facebook.showDialog( "apprequests", { message = "Example message." }) --]] end -- Request the Platform information (FB information) if fbCommand == GET\_PLATFORM\_INFO then facebook.request( "platform" ) -- \*\*tjn Displays info about Facebook platform end -- Request the current logged in user's info if fbCommand == GET\_USER\_INFO then facebook.request( "me" ) -- facebook.request( "me/friends" ) -- Alternate request end -- This code posts a photo image to your Facebook Wall -- if fbCommand == POST\_PHOTO then --[[local attachment = { message="KawaiiDressUp Creation!", source= {baseDir=system.DocumentsDirectory, filename="Icon.png", type="image"} }]]-- local attachment = { name = "I did GOOD!", link = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png", caption = "do good today @ goodfluence.com", description = "test", picture = "http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png", --picture = "Icon.png", actions = json.encode( { { name = "Learn More", link = "http://goodfluence.com" } } ) } facebook.request( "me/feed", "POST", attachment ) -- posting the photo end -- This code posts a message to your Facebook Wall if fbCommand == POST\_MSG then local time = os.date("\*t") local postMsg = { message = "Test Post For Goodfluence! " .. os.date("%A, %B %e") .. ", " .. time.hour .. ":" .. time.min .. "." .. time.sec } facebook.request( "me/feed", "POST", postMsg ) -- posting the message end ----------------------------------------------------------------------------------------- elseif ( "request" == event.type ) then -- event.response is a JSON object from the FB server local response = event.response if ( not event.isError ) then response = json.decode( event.response ) if fbCommand == GET\_USER\_INFO then statusMessage.textObject.text = response.name printTable( response, "User Info", 3 ) print( "name", response.name ) elseif fbCommand == POST\_PHOTO then --printTable( response, "photo", 3 ) print("Photo Posted") -- local alert = native.showAlert( "Daily Do Good", "Your Post has been successfully submited", { "Done", "Post To Twitter"}, onComplete5) elseif fbCommand == POST\_MSG then printTable( response, "message", 3 ) statusMessage.textObject.text = "Message Posted" else -- Unknown command response print( "Unknown command response" ) statusMessage.textObject.text = "Unknown ?" end else -- Post Failed statusMessage.textObject.text = "Post failed" printTable( event.response, "Post Failed Response", 3 ) end elseif ( "dialog" == event.type ) then -- showDialog response -- print( "dialog response:", event.response ) statusMessage.textObject.text = event.response end end local appId = "xxxx" local apiKey = nil -- Not needed at this time function postPhoto\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = POST\_PHOTO facebook.login( appId, listener, {"publish\_actions"} ) end local function getInfo\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = GET\_USER\_INFO facebook.login( appId, listener, {"publish\_actions"} ) end local function postMsg\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = POST\_MSG facebook.login( appId, listener, {"publish\_actions"} ) end local function showDialog\_onRelease( event ) -- call the login method of the FB session object, passing in a handler -- to be called upon successful login. fbCommand = SHOW\_DIALOG facebook.login( appId, listener, {"publish\_actions"} ) end postPhoto\_onRelease() print( "Button was pressed and released" ) end end local facebookButton = widget.newButton { left = 100, top = 100, id = "button2", label = "Facebook", onEvent = handleButtonEvent2 }

build.settings

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, 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 = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay, FacebookAppID = "xxxxx", UIApplicationExitsOnSuspend = false, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbxxxxx", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }

I am an idiot. I was commenting out the iOS bundle schemes. I think that fixed it!