@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", },]]-- }