nope… only the prints of listener … event.type : session, isError: true, didComplete: nil
Are you filtering only Corona output or are you just running “adb logcat” without any additional parameters?
Rob
I’m not sure if I understand what you said but as we can’t run facebook on simulator, I deploy to my iphone and them check the xcode console to see what’s going on… and I only get theses print on console when I tried to connect to facebook… so when I tried, a message asking permition apear and after that nothing… only get there prints and nothing more =/
Okay, this isn’t an Android issue, but an iOS issue, sorry for making that assumption. This is a very common thing for people on Android to encounter. Since you’re on iOS, are you tethering your test device to your Mac and running Xcode’s organizer and watching the Console log there?
It would also be very helpful to get a screen shot of your app page on developers.facebook.com, the build screen from corona just before you hit the build button and your build.settings file. If you could post those here, it would be great.
Thanks
Rob
Yea i`m doing that on organize and stuffs…
here is my code of building
settings = { -- enable the admob plugin plugins = { ["CoronaProvider.ads.admob"] = { -- required publisherId = "com.coronalabs", }, -- key is the name passed to Lua's 'require()' ["CoronaProvider.native.popup.social"] = { -- required publisherId = "com.coronalabs", }, ["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, }, }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, 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-40.png", "Icon-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, UIApplicationExitsOnSuspend = false, FacebookAppID = "1389442937944862", --replace XXXXXXXXXX with your Facebook App ID CFBundleURLTypes = { { CFBundleURLSchemes = { "fb1389442937944862", } --replace XXXXXXXXXX with your Facebook App ID } } } }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.VIBRATE", }, }, }
and my code to logIn and try some request:
------------------------------------------- local storyboard = require( "storyboard" ) local scene = storyboard.newScene() ------------------------------------------- local ragdogLib = require "ragdogLib"; local json = require( "json" ); local facebook = require( "facebook" ); local fbAppID = "1389442937944862" ------------------------------------------- -- Variaveis local bg local timerT local centerX = \_G.centerX local centerY = \_G.centerY local totalWidth = \_G.totalWidth local totalHeight = \_G.totalHeight local leftSide = \_G.leftSide local rightSide = \_G.rightSide local topSide = \_G.topSide local bottomSide = \_G.bottomSide ------------------------------------------- -- Funções local mudaCena = function() local options = { effect = "fade", time = 500, params = { var1 = "testeFacebook", var2 = "mainMenu", } } storyboard.gotoScene( "destroiCenaAnterior", options ); end -- Compartilhar local postaSocial = function( nome ) local isAvailable = native.canShowPopup( 'social', nome ); -- If it is possible to show the popup if isAvailable then local listener = {} function listener:popup( event ) --print( "name(" .. event.name .. ") type(" .. event.type .. ") action(" .. tostring(event.action) .. ") limitReached(" .. tostring(event.limitReached) .. ")" ) if tostring(event.action) == 'sent' then print( 'ENVIOU ENVIOU ENVIOU' ) end end -- Show the popup native.showPopup( 'social', { service = nome, -- The service key is ignored on Android. message = "Test", listener = listener, --[[image = { { filename = "fotoSS.png", baseDir = system.DocumentsDirectory }, }, url ={ "https://play.google.com/store/search?q=bee%20flappy&c=apps&hl=pt\_BR" }]]-- }); else native.showAlert( "Cannot send " .. nome .. " message.", "Please setup your " .. nome .. " account or check your network connection", { "OK" } ) end end -- Facebook Requests local comecaFb = function() ----------------------------------------------------------------- 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" if ( "login" == event.phase ) then local access\_token = event.token --code for tasks following a successful login end elseif ( "request" == event.type ) then print("facebook request") if ( not event.isError ) then local response = json.decode( event.response ) --process response data here print( response ) end elseif ( "dialog" == event.type ) then print( "dialog", event.response ) --handle dialog results here end end ----------------------------------------------------------------- facebook.login( fbAppID, FBlistener, { "publish\_actions, users\_like" } ) ----------------------------------------------------------------- local fbBtnShare2 = ragdogLib.newSimpleButton( grupoShare, "IMG/shareIMG/fbIcone.png", 45, 45); fbBtnShare2.x, fbBtnShare2.y = centerX - 150, centerY - 15; function fbBtnShare2:touchBegan() self:setFillColor(.5, .5, .5); self.xScale, self.yScale = .9, .9; end function fbBtnShare2:touchEnded() --audio.play(buttonSFX, {channel = audio.findFreeChannel()}); self:setFillColor(1, 1, 1); self.xScale, self.yScale = 1, 1; facebook.request( "me/feed", FBlistener ,"POST", { message = "teste" } ) end facebook.request( "me/feed", "POST", { message="teste" } ) end ------------------------------------------- function scene:createScene( event ) local screenGroup = self.view; local fbBtnShare = ragdogLib.newSimpleButton( grupoShare, "IMG/shareIMG/fbIcone.png", 45, 45); fbBtnShare.x, fbBtnShare.y = centerX + 50, centerY - 15; function fbBtnShare:touchBegan() self:setFillColor(.5, .5, .5); self.xScale, self.yScale = .9, .9; end function fbBtnShare:touchEnded() --audio.play(buttonSFX, {channel = audio.findFreeChannel()}); self:setFillColor(1, 1, 1); self.xScale, self.yScale = 1, 1; local var = 'facebook'; postaSocial( var ); end end ------------------------------------------- -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) comecaFb() end ------------------------------------------- function scene:exitScene( event ) -- end ------------------------------------------- -- Called prior to the removal of scene's "view" (display group) function scene:destroyScene( event ) local group = self.view ----------------------------------------------------------------------------- -- INSERT code here (e.g. remove listeners, widgets, save state, etc.) ----------------------------------------------------------------------------- bg = nil timerT = nil centerX = nil centerY = nil totalWidth = nil totalHeight = nil leftSide = nil rightSide = nil topSide = nil bottomSide = nil end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- "createScene" event is dispatched if scene's view does not exist scene:addEventListener( "createScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) --------------------------------------------------------------------------------- return scene
Don’t know WHY but know it is working o.O
even the request.
The problem now is that I can’t post on my Facebook’s feed although I get Facebook Request message…
knows anything about it? and how should I be able to see inside the response?
I tried print( event.response ) and it shows me “tabx340x0545” something like that…
Thanks Rob
I don’t see you including the facebook plugin. Around 2169, we moved Facebook to an optional plugin for iOS. Check the current docs for the facebook for the plugin code.
Rob
look again on my building
there he is
[“facebook”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone = true },
},
I can’t make requests work =/
A couple of things to try. Instead of this:
facebook.login( fbAppID, FBlistener, { “publish_actions, users_like” } )
try this:
facebook.login( fbAppID, FBlistener, { “publish_actions”, “users_like” } )
Next, you probably should not call this:
facebook.request( “me/feed”, “POST”, { message=“teste” } )
Until you’ve gotten a successful login call back. Usually this call happens inside of the FBListener.
ROb
Still can’t make requests… I tried to do this:
facebook.request( “me/feed”, “POST”, { message = ‘Teste’ } )
and in console shows HTTP status code 403…
Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: Error: HTTP status code: 403 Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: event.name fbconnect Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: event.type: request Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: isError: true Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: didComplete: nil Mar 12 21:10:33 iPhone-de-Douglas DumbEggs[1537] \<Warning\>: facebook request Mar 12 21:10:35 iPhone-de-Douglas profiled[1541] \<Notice\>: (Note ) profiled: Service starting... Mar 12 21:10:36 iPhone-de-Douglas backupd[1542] \<Warning\>: INFO: Account changed (enabled=0, accountID=1169055204) Mar 12 21:10:37 iPhone-de-Douglas kernel[0] \<Debug\>: AppleKeyStore: operation failed (pid: 1542 sel: 23 ret: e00002f0) Mar 12 21:10:38 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 21:10:38 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 21:10:38 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate B0716A4C-742C-41F8-9DDF-91E3007683D7 finished a refresh but it is not registered with the refresh manager Mar 12 21:10:38 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 21:10:38 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate 7564AF72-29E0-417B-A3B3-34E6E03FF706 finished a refresh but it is not registered with the refresh manager Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate 1CAEC256-F00F-4FD8-BAC3-E6DDD9846A51 finished a refresh but it is not registered with the refresh manager Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 21:10:39 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:39 iPhone-de-Douglas aosnotifyd[526] \<Notice\>: 2014-03-12 21:10:39.990 aosnotifyd[526:2311]: -[ACAccount isEnabledForDataclass:] should not be relied on to get the status of FMiP. It may return inaccurate results. Use AADeviceLocatorService instead. Mar 12 21:10:41 iPhone-de-Douglas aosnotifyd[526] \<Notice\>: 2014-03-12 21:10:41.265 aosnotifyd[526:2311]: -[ACAccount isEnabledForDataclass:] should not be relied on to get the status of FMiP. It may return inaccurate results. Use AADeviceLocatorService instead. Mar 12 21:10:41 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:42 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocol14\_0 Mar 12 21:10:42 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocol14\_0 Mar 12 21:10:42 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:43 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/contacts/ Mar 12 21:10:43 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 21:10:44 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/contacts/addressbook/ Mar 12 21:10:48 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:48 iPhone-de-Douglas profiled[1541] \<Notice\>: (Note ) profiled: Service stopping. Mar 12 21:10:48 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:49 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:49 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/calendars/ Mar 12 21:10:50 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 21:10:52 iPhone-de-Douglas syncdefaultsd[1512] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 21:11:59 iPhone-de-Douglas timed[18] \<Notice\>: (Note ) CoreTime: Received timezone "America/Sao\_Paulo" from "Location" Mar 12 21:11:59 iPhone-de-Douglas timed[18] \<Notice\>: (Note ) CoreTime: Current mcc: '724' simulated:'0'. Mar 12 21:11:59 iPhone-de-Douglas timed[18] \<Notice\>: (Note ) CoreTime: Not setting time zone to America/Sao\_Paulo from Location
and in logIn I get this:
Mar 12 21:14:24 iPhone-de-Douglas DumbEggs[1544] \<Warning\>: event.name fbconnect Mar 12 21:14:24 iPhone-de-Douglas DumbEggs[1544] \<Warning\>: event.type: session Mar 12 21:14:24 iPhone-de-Douglas DumbEggs[1544] \<Warning\>: isError: false Mar 12 21:14:24 iPhone-de-Douglas DumbEggs[1544] \<Warning\>: didComplete: nil
403 is a permission denied error from host HTTP servers. Are there more more messages before the login? before the request? Can you post your current code? Can you add a print in the session block of the listener to print out your event.token?
Thanks
Rob
I can’t post image because the forum says that I only can post an image with 352k so I put the console here…
all my console… running app and them going to facebook screen and them press request button:
Mar 12 23:43:50 iPhone-de-Douglas SpringBoard[34] \<Warning\>: LICreateIconForImage passed NULL CGImageRef image Mar 12 23:43:50 iPhone-de-Douglas kernel[0] \<Debug\>: launchd[1838] Container: /private/var/mobile/Applications/A0A1122B-4A51-4552-800F-E040BD794097 (sandbox) Mar 12 23:43:51 iPhone-de-Douglas backboardd[28] \<Error\>: HID: The 'Passive' connection 'DumbEggs' access to protected services is denied. Mar 12 23:43:51 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: Platform: iPhone / iPhone3,1 / 7.1 / PowerVR SGX 535 / OpenGL ES 2.0 IMGSGX535-97.7 Mar 12 23:43:51 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: luaopen\_CoronaProvider\_ads\_admob Mar 12 23:43:51 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: \<Google\> To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:@"351af24c82a3309d5d10dbadeb8bbe27", nil]; Mar 12 23:43:53 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: \<Google:HTML\> Google Mobile Ads SDK: You are currently using 6.4.1 of the SDK. A new version, 6.8.0, is available at http://goo.gl/Zc0BYt . Please consider updating your SDK to get the latest features and bug fixes Mar 12 23:43:54 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: deleta: splashScene Mar 12 23:43:54 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: proximaTela: mainMenu Mar 12 23:44:06 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: testeFacebook Mar 12 23:44:08 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: deleta: mainMenu Mar 12 23:44:08 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: proximaTela: testeFacebook Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.name fbconnect Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.type: session Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: isError: false Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: didComplete: nil Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: Token: CAATvsOTAex4BAF3JUde4pV9ZCJEWHN10kVz5tNamBpbecSZBrJxqnRrWADvAzw8yd2SurEIZAJfXy0YQssLyOECE8XCUNtGL6NFeaYvJgEn0ygHI84JqZCHDETQ4JnaXJNq2LiZBF5RrluZCVQ5l1O3vXWZC56QSsyUnZAuqzC9lGzAZBN0T04cOP8pQGbM9ON0ZAPLnh9Oo7gj2YE6qVRegj72t9gTsvZBwUBi2HCUGpnyJAZDZD Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: Error: HTTP status code: 403 Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.name fbconnect Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.type: request Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: isError: true Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: didComplete: nil Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: facebook request Mar 12 23:44:20 iPhone-de-Douglas profiled[1842] \<Notice\>: (Note ) profiled: Service starting... Mar 12 23:44:21 iPhone-de-Douglas backupd[1843] \<Warning\>: INFO: Account changed (enabled=0, accountID=1169055204) Mar 12 23:44:21 iPhone-de-Douglas kernel[0] \<Debug\>: AppleKeyStore: operation failed (pid: 1843 sel: 23 ret: e00002f0) Mar 12 23:44:22 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 23:44:22 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate B0716A4C-742C-41F8-9DDF-91E3007683D7 finished a refresh but it is not registered with the refresh manager Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate 7564AF72-29E0-417B-A3B3-34E6E03FF706 finished a refresh but it is not registered with the refresh manager Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|DA|Warn |Delegate 1CAEC256-F00F-4FD8-BAC3-E6DDD9846A51 finished a refresh but it is not registered with the refresh manager Mar 12 23:44:23 iPhone-de-Douglas aosnotifyd[526] \<Notice\>: 2014-03-12 23:44:23.208 aosnotifyd[526:2311]: -[ACAccount isEnabledForDataclass:] should not be relied on to get the status of FMiP. It may return inaccurate results. Use AADeviceLocatorService instead. Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 23:44:23 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown Mar 12 23:44:24 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:24 iPhone-de-Douglas aosnotifyd[526] \<Notice\>: 2014-03-12 23:44:24.557 aosnotifyd[526:2311]: -[ACAccount isEnabledForDataclass:] should not be relied on to get the status of FMiP. It may return inaccurate results. Use AADeviceLocatorService instead. Mar 12 23:44:24 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:25 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:25 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/contacts/ Mar 12 23:44:26 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocol14\_0 Mar 12 23:44:26 iPhone-de-Douglas dataaccessd[107] \<Notice\>: 0x145314b0|EAS|Note |EAS Protocol Manager set to ASProtocol14\_0 Mar 12 23:44:27 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/contacts/addressbook/ Mar 12 23:44:27 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 23:44:30 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:30 iPhone-de-Douglas dataaccessd[107] \<Error\>: TASK-ASSERT: cfurlcache - ProcessCacheTask - FAILED to get task-assertion, going commando with 1 items to process. Mar 12 23:44:30 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:31 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:31 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/calendars/ Mar 12 23:44:32 iPhone-de-Douglas dataaccessd[107] \<Warning\>: AOSKit ERROR: Invalid url, cannot return auth info: https://douglas.hennrich@webdav.facebook.com/100000762748887/ Mar 12 23:44:33 iPhone-de-Douglas profiled[1842] \<Notice\>: (Note ) profiled: Service stopping.
and here is my “testeFacebook.lua”, where I logIn and make my button to make request( the button name is “fbBtnShare2” ):
------------------------------------------- local storyboard = require( "storyboard" ) local scene = storyboard.newScene() ------------------------------------------- local ragdogLib = require "ragdogLib"; local json = require( "json" ); local facebook = require( "facebook" ); local fbAppID = "1389442937944862" ------------------------------------------- -- Variaveis local bg local timerT local centerX = \_G.centerX local centerY = \_G.centerY local totalWidth = \_G.totalWidth local totalHeight = \_G.totalHeight local leftSide = \_G.leftSide local rightSide = \_G.rightSide local topSide = \_G.topSide local bottomSide = \_G.bottomSide ------------------------------------------- -- Funções local mudaCena = function() local options = { effect = "fade", time = 500, params = { var1 = "testeFacebook", var2 = "mainMenu", } } storyboard.gotoScene( "destroiCenaAnterior", options ); end -- Compartilhar local postaSocial = function( nome ) local isAvailable = native.canShowPopup( 'social', nome ); -- If it is possible to show the popup if isAvailable then local listener = {} function listener:popup( event ) --print( "name(" .. event.name .. ") type(" .. event.type .. ") action(" .. tostring(event.action) .. ") limitReached(" .. tostring(event.limitReached) .. ")" ) if tostring(event.action) == 'sent' then print( 'ENVIOU ENVIOU ENVIOU' ) end end -- Show the popup native.showPopup( 'social', { service = nome, -- The service key is ignored on Android. message = "Test", listener = listener, --[[image = { { filename = "fotoSS.png", baseDir = system.DocumentsDirectory }, }, url ={ "https://play.google.com/store/search?q=bee%20flappy&c=apps&hl=pt\_BR" }]]-- }); else native.showAlert( "Cannot send " .. nome .. " message.", "Please setup your " .. nome .. " account or check your network connection", { "OK" } ) end end -- Facebook Requests local comecaFb = function() ----------------------------------------------------------------- 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" if ( "login" == event.phase ) then local access\_token = event.token --code for tasks following a successful login print( 'Token: ' .. access\_token ) end elseif ( "request" == event.type ) then print("facebook request") if ( not event.isError ) then local data = json.decode( event.response ) local data2 --process response data here print( "data: " .. data ) print( "event.response: " .. data2 ) else print( "event.isError: " .. event.isError ) end elseif ( "dialog" == event.type ) then print( "dialog", event.response ) --handle dialog results here end end ----------------------------------------------------------------- facebook.login( fbAppID, FBlistener, { "publish\_actions, user\_likes, publish\_stream" } ) ----------------------------------------------------------------- local fbBtnShare2 = ragdogLib.newSimpleButton( grupoShare, "IMG/shareIMG/fbIcone.png", 45, 45); fbBtnShare2.x, fbBtnShare2.y = centerX - 150, centerY - 15; function fbBtnShare2:touchBegan() self:setFillColor(.5, .5, .5); self.xScale, self.yScale = .9, .9; end function fbBtnShare2:touchEnded() --audio.play(buttonSFX, {channel = audio.findFreeChannel()}); self:setFillColor(1, 1, 1); self.xScale, self.yScale = 1, 1; facebook.request( "me/feed", "POST", { message = 'Test' } ) end end ------------------------------------------- function scene:createScene( event ) local screenGroup = self.view; local fbBtnShare = ragdogLib.newSimpleButton( grupoShare, "IMG/shareIMG/fbIcone.png", 45, 45); fbBtnShare.x, fbBtnShare.y = centerX + 50, centerY - 15; function fbBtnShare:touchBegan() self:setFillColor(.5, .5, .5); self.xScale, self.yScale = .9, .9; end function fbBtnShare:touchEnded() --audio.play(buttonSFX, {channel = audio.findFreeChannel()}); self:setFillColor(1, 1, 1); self.xScale, self.yScale = 1, 1; local var = 'facebook'; postaSocial( var ); end end ------------------------------------------- -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) comecaFb() end ------------------------------------------- function scene:exitScene( event ) -- end ------------------------------------------- -- Called prior to the removal of scene's "view" (display group) function scene:destroyScene( event ) local group = self.view ----------------------------------------------------------------------------- -- INSERT code here (e.g. remove listeners, widgets, save state, etc.) ----------------------------------------------------------------------------- bg = nil timerT = nil centerX = nil centerY = nil totalWidth = nil totalHeight = nil leftSide = nil rightSide = nil topSide = nil bottomSide = nil end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- "createScene" event is dispatched if scene's view does not exist scene:addEventListener( "createScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) --------------------------------------------------------------------------------- return scene
this is it…
Thanks for your trying Rob 
Can you move this line:
facebook.request( “me/feed”, “POST”, { message = ‘Test’ } )
to:
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" if ( "login" == event.phase ) then local access\_token = event.token --code for tasks following a successful login print( 'Token: ' .. access\_token ) -------\> move the request here \<--------- end elseif ( "request" == event.type ) then
Because this is an asynchronous operation, I think your facebook.request() call is happening before the facebook.login() is complete.
Rob
is not =/
the facebook.request() only happens when I hit the button… and I wait the console tells me that the session finish to hit the button and make the request… the strange thing is… I notice that on login listener… the “didComplete” returns “nil”
Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.name fbconnect Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.type: session Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: isError: false Mar 12 23:44:09 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: didComplete: nil
the console for request is this:
Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: Error: HTTP status code: 403 Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.name fbconnect Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: event.type: request Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: isError: true Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: didComplete: nil Mar 12 23:44:18 iPhone-de-Douglas DumbEggs[1838] \<Warning\>: facebook request Mar 12 23:44:20 iPhone-de-Douglas profiled[1842] \<Notice\>: (Note ) profiled: Service starting... Mar 12 23:44:21 iPhone-de-Douglas backupd[1843] \<Warning\>: INFO: Account changed (enabled=0, accountID=1169055204)
Maybe something are wrong because it says “Account changed” … and this “Error: HTTP status code: 403” you said that is a permission problem… but I double check the permission and it’s alright… it shows asking for permission and everything… so I don’t understand WHY it is a permission problem =/
maybe is some problem with facebook module? some URL request problem… don’t know…
Please see my response at the end of this thread: http://forums.coronalabs.com/topic/44889-facebook-posting-on-android/
Thanks Rob… your code solve the problem!! don’t know why but it works!