Facebook broken in later builds - sample app works with earlier sdk versions but not latest

Hi!

It seems like the Facebook support is currently broken, at least according to the official Facebook sample app.

The exact same code I had used in an older project would not work while working on a new app – but the older app still worked in its compiled state.

So, for testing, I downloaded the Facebook Sample app and compiled it with the latest stable Corona SDK release (Build: 2011.591). Did not work - basically nothing happens after the login-box is shown - whether trying to post photo, msg or get user. Then I compiled the exact same source files with it with an older SDK version I had on my computer (Build: 2011.484) - works perfectly!

This was on an iPad and iPhone 4, both xCode simulator and actual device.

It is hard to troubleshoot – all that is returned in the console is hundreds of the string "Facebook listener events:" without any further info.

Something is obviously wrong with the newer releases. Am I the only one experiencing this? It seems like a big problem that Ansca should be notified about.

I would hate to have to go back and compile using old SDK versions for new apps.

So: Does anybody have any current Facebook code that is confirmed to work with the latest release?

I tried to duplicate your problem and the Facebook app is working fine for me. I built the Facebook sample app with build 591 and installed it on an iPhone4 running 4.3.5. I was able to logon, get User info and post a message without any problems. We did test this sample on a number of devices when we were releasing build 591.

If you are getting a number of blank messages in Xcode Console, it may mean there it is seeing an error in the FB listener code. I noticed that the "event" parameter will contain an error string and not a table if it finds an error. Here is some code you can replace at the top of the FB listener. (I removed the general table display code since it was could also generate some errors.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local function listener( event )
 
--- Debug Event parameters printout --------------------------------------------------
        print( "Facebook Listener events:" )
 
        -- Handle the case where event is returning an error string
        if "string" == type( event ) then
                print( "Event String: " .. string.sub(event, 1, 60 ) )  -- print first number of characters of string
        end
 
    print( "event.name", tostring( event.name ) ) -- "fbconnect"
    print( "event.type:", tostring( event.type ) ) -- type is either "session" or "request" or "dialog"
        print( "isError: " .. tostring( event.isError ) )
        print( "didComplete: " .. tostring( event.didComplete) )
-----------------------------------------------------------------------------------------

I have been wrestling with FB code for a couple days now; so if it's broken - this will be a relief, and also very frustrating.

We have no open bug reports saying Facebook is broken and from our testing, build 591 and our sample app does work. If you have a situation where the sample app doesn't work, please file a bug report with a way we can reproduce the problem. Saying that the sample app doesn't work is not something we can troubleshoot unless you can outline the failing case and we can reproduce it.

Our FB API uses the publicly available FB SDK provide by FB. There may be other factors that are causing issues for users like other apps installed or even the official FB app itself. We would like to hear from you if you have found something that causes our sample to fail.

Thanks,
Tom

As it turns out, the SDK FB Code does in fact work. Somehow my FB page is blocking posts from the FB App; both text and pictures. This is an important side effect that I "believe" has been triggered due to unintentional flooding yesterday. Somehow the FB account I was using to test my app has now "blocked" posts.

I have been able to use the SDK FB code to post successfully to my PERSONAL FB wall. So the code is fine.

I cannot find anywhere on FB Help page any information about "temporary blocks" or HOW / WHO I can contact at FB to discuss this problem.

I would like to hear if anyone else has experienced this kind of "flood blocking" implementation from FB if they detect a large flood of posts from your App.

Hi Guys,

Sorry for the late reply, had to focus on other projects and client work.

Anyway, I got Facebook posting working in my app using pretty much the example code from the resource pages:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local facebook = require "facebook"
 
-- listener for "fbconnect" events
local function listener( event )
    if ( "session" == event.type ) then
        -- upon successful login, request list of friends of the signed in user
        if ( "login" == event.phase ) then
            --facebook.request( "me/friends" )
                        facebook.request( "me/feed", "POST", {message = "Hello Facebook"} )
        end
    elseif ( "request" == event.type ) then
        -- event.response is a JSON object from the FB server
        local response = event.response
 
        -- if request succeeds
        if ( not event.isError ) then
            --response = json.decode( event.response )
        end
    elseif ( "dialog" == event.type ) then
        --print( "dialog", event.response )
    end
end
 
-- NOTE: You must provide a valid application id provided from Facebook
local appId = "YOUR APP ID GOES HERE"
if ( appId ) then
        facebook.login( appId, listener, {"publish_stream"} )
else
        local function onComplete( event )
                system.openURL( "http://developers.facebook.com/setup" )
        end
 
        native.showAlert( "Error", "To develop for Facebook Connect, you need to get an application id from Facebook's website.", { "Learn More" }, onComplete )
end
views:1679 update:2011/9/27 8:54:05
corona forums © 2003-2011