Facebook broken (since at least 1034)

Hi everybody,

Its seems that facebook is not working properly, especially when you try to post a photo (uploaded, or remote).

Step to reproduce, take the sample facebook app : CoronaSDK/Sample/Networking/Facebook

Make sure you fill your app id in main.lua and build.settings
You have to add another key in build.settings

 FacebookAppID = "YOUR\_APP\_ID",  
 CFBundleURLTypes =  
 {  
 {  
 CFBundleURLSchemes =  
 {  
 "fbYOUR\_APP\_ID",  
 "fbYOUR\_APP\_IDYOUR\_CUSTOM\_SUFFIX", -- optional, but if you use suffix, you've got to do it this way (i don't know why but i'm glad i found out :) )  
 }  
 },  
 },  

Now try to post a photo (using your device), its doesn’t work.

After a few try, it seems that if you fill all the keys in your post attachments it works, but you get no valid response from the api :

[code]

Mar 12 10:45:04 iPhone 2.05[1353] : Facebook Listener events:
Mar 12 10:45:04 iPhone 2.05[1353] : type(session)
Mar 12 10:45:04 iPhone 2.05[1353] : name(fbconnect)
Mar 12 10:45:04 iPhone 2.05[1353] : expiration(1368182203)
Mar 12 10:45:04 iPhone 2.05[1353] : phase(login)
Mar 12 10:45:04 iPhone 2.05[1353] : token(BAADx9Li5PFwBAPTSDun … #135)
Mar 12 10:45:04 iPhone 2.05[1353] : isError(false)
Mar 12 10:45:04 iPhone 2.05[1353] : response()
Mar 12 10:45:04 iPhone 2.05[1353] : event.name fbconnect
Mar 12 10:45:04 iPhone 2.05[1353] : event.type: session
Mar 12 10:45:04 iPhone 2.05[1353] : isError: false
Mar 12 10:45:04 iPhone 2.05[1353] : didComplete: nil
Mar 12 10:45:04 iPhone 2.05[1353] : Session Status: login
Mar 12 10:45:13 iPhone 2.05[1353] : Facebook Listener events:
Mar 12 10:45:13 iPhone 2.05[1353] : isError(false)
Mar 12 10:45:13 iPhone 2.05[1353] : type(request)
Mar 12 10:45:13 iPhone 2.05[1353] : name(fbconnect)
Mar 12 10:45:13 iPhone 2.05[1353] : response({“id”:"1055468039_35 … #35)
Mar 12 10:45:13 iPhone 2.05[1353] : event.name fbconnect
Mar 12 10:45:13 iPhone 2.05[1353] : event.type: request
Mar 12 10:45:13 iPhone 2.05[1353] : isError: false
Mar 12 10:45:13 iPhone 2.05[1353] : didComplete: nil
[/code]

Worse, from my android device (nexus4) i’ve got java exceptions :

<br><br>I/Corona (19623): Facebook Listener events:<br>I/Corona (19623): type(session)<br>I/Corona (19623): name(fbconnect)<br>I/Corona (19623): expiration(1368182201)<br>I/Corona (19623): phase(login)<br>I/Corona (19623): token(BAADx9Li5PFwBADGxzeW ... #132)<br>I/Corona (19623): isError(false)<br>I/Corona (19623): response()<br>I/Corona (19623): event.name fbconnect<br>I/Corona (19623): event.type: session<br>I/Corona (19623): isError: false<br>I/Corona (19623): didComplete: nil<br>I/Corona (19623): Session Status: login<br>W/Bundle (19623): Key message expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key picture expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key description expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key name expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key link expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key caption expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key format expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key access_token expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:155)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>D/dalvikvm(19623): GC_CONCURRENT freed 4218K, 13% free 12426K/14272K, paused 3ms+3ms, total 24ms<br>W/Bundle (19623): Key message expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key picture expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key description expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key name expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key link expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key method expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key caption expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key format expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>W/Bundle (19623): Key access_token expected byte[] but value was a java.lang.String. The default value <null> was returned.<br>W/Bundle (19623): Attempt to cast generated internal exception:<br>W/Bundle (19623): java.lang.ClassCastException: java.lang.String cannot be cast to byte[]<br>W/Bundle (19623): at android.os.Bundle.getByteArray(Bundle.java:1378)<br>W/Bundle (19623): at com.facebook.android.Util.encodePostBody(Util.java:63)<br>W/Bundle (19623): at com.facebook.android.Util.openUrl(Util.java:182)<br>W/Bundle (19623): at com.facebook.android.Facebook.request(Facebook.java:563)<br>W/Bundle (19623): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)<br>D/dalvikvm(14857): GC_CONCURRENT freed 1482K, 13% free 12801K/14560K, paused 5ms+7ms, total 88ms<br>D/dalvikvm(14857): GC_CONCURRENT freed 1306K, 12% free 12859K/14560K, paused 9ms+5ms, total 69ms<br>I/Corona (19623): Facebook Listener events:<br>I/Corona (19623): type(request)<br>I/Corona (19623): name(fbconnect)<br>I/Corona (19623): didComplete(false)<br>I/Corona (19623): isError(false)<br>I/Corona (19623): response({"id":"1055468039_50 ... #35)<br>I/Corona (19623): event.name fbconnect<br>I/Corona (19623): event.type: request<br>I/Corona (19623): isError: false<br>I/Corona (19623): didComplete: false<br><br>
Any help, please ? :slight_smile:

[import]uid: 3638 topic_id: 37595 reply_id: 67595[/import]

Nothing has changed in Facebook since build 1034. iOS Facebook library was updated in build 1028. Android Facebook hasn’t changed since the release build, 971. [import]uid: 7559 topic_id: 37595 reply_id: 145832[/import]

 

I also am having issues with Facebook it WORKS for me in build 1012,  and i upgraded to 1041 and my code is unchanged and it wont post a picture to facebook.   i upgraded to build 1043 and STILL doesnt post to facebook.   i downgrade to build 1012, and my code WORKS…  my code IS your example code of how to post a picture to facebook.  I think i pulled it from one of the corona blog posts.

 

[lua]

 

    --************************************************************************

    --*****     Facebook Shit

    --************************************************************************

    local facebook = require “facebook”

    local filename = “monkey”    

    

    local onLoginSuccess,fbListener

    

    – You must use your own app id for this sample to work

    local fbAppID = “???”  --Penguin Rescue blanked out my code.

     

    function onLoginSuccess()

        – Upload ‘iheartcorona.jpg’ to current user’s account

        local attachment = {

            message = “Penguin Rescue - Coming Soon! brought to you by Learning Gems - www.learninggems.com”,

            --source = { baseDir=system.ResourceDirectory, filename=“images/common/penguin-slope-mountains.png”, type=“image” }

            source = { baseDir=system.CachesDirectory, filename=filename, type=“image” }

        }

        

        facebook.request( “me/photos”, “POST”, attachment )

    end

     

    – facebook listener

    function fbListener( event )

         mysounds.play(5,0)

           

        if event.isError then

            native.showAlert( “ERROR”, event.response, { “OK” } )

        else

            if event.type == “session” and event.phase == “login” then

                – login was a success; call function

                onLoginSuccess()

            

            elseif event.type == “request” then

                – this block is executed upon successful facebook.request() call

     

                native.showAlert( “Success”, “The photo has been uploaded.”, { “OK” } )

            end

        end

    end

     

    – photo uploading requires the “publish_stream” permission

  facebook.login( fbAppID, fbListener, { “publish_stream” } ) 

[/lua]

For Android, nothing has changed. For iOS changes made to build 1028 require an extra FB application ID in the build.settings file. You will find this in the Facebook sample code shipped with the latest Daily Build. It’s also been mentioned here on the forums.

 

If you are still having problems, file a bug report with a complete Corona project that’s failing. Include build information, device type  and steps to reproduce the problem.

Thanks Tom,

 

Just to be clear :

 

I didn’t change anything in the sample, except i filled my App id (on build.settings, and in main.lua) (and i also add FacebookAppID = “YOUR_APP_ID” in build.settings).

Then i clicked on post photo and it doesn’t work.

 

The way i explained it could look dumb, but it’s the only way that i found to prove that something is not working.

Yes i had all the information included in my build.settings that was needed.  

 

i know you just did Widgets 2.0 and right behind that was Network 2.0.   Could something in the network 2.0 be affecting this?  I will submit a bug report.

 

I just posted this as a bug report:  : (Case 21676) Facebook not posting pictures.  I could NOT strip my project down small enough to get it to upload the whole project since your website  only allows for a 10mb attachement.  So i supplied a link to my full project in a zip file from my server.

Nothing has changed in Facebook since build 1034. iOS Facebook library was updated in build 1028. Android Facebook hasn’t changed since the release build, 971. [import]uid: 7559 topic_id: 37595 reply_id: 145832[/import]

 

I also am having issues with Facebook it WORKS for me in build 1012,  and i upgraded to 1041 and my code is unchanged and it wont post a picture to facebook.   i upgraded to build 1043 and STILL doesnt post to facebook.   i downgrade to build 1012, and my code WORKS…  my code IS your example code of how to post a picture to facebook.  I think i pulled it from one of the corona blog posts.

 

[lua]

 

    --************************************************************************

    --*****     Facebook Shit

    --************************************************************************

    local facebook = require “facebook”

    local filename = “monkey”    

    

    local onLoginSuccess,fbListener

    

    – You must use your own app id for this sample to work

    local fbAppID = “???”  --Penguin Rescue blanked out my code.

     

    function onLoginSuccess()

        – Upload ‘iheartcorona.jpg’ to current user’s account

        local attachment = {

            message = “Penguin Rescue - Coming Soon! brought to you by Learning Gems - www.learninggems.com”,

            --source = { baseDir=system.ResourceDirectory, filename=“images/common/penguin-slope-mountains.png”, type=“image” }

            source = { baseDir=system.CachesDirectory, filename=filename, type=“image” }

        }

        

        facebook.request( “me/photos”, “POST”, attachment )

    end

     

    – facebook listener

    function fbListener( event )

         mysounds.play(5,0)

           

        if event.isError then

            native.showAlert( “ERROR”, event.response, { “OK” } )

        else

            if event.type == “session” and event.phase == “login” then

                – login was a success; call function

                onLoginSuccess()

            

            elseif event.type == “request” then

                – this block is executed upon successful facebook.request() call

     

                native.showAlert( “Success”, “The photo has been uploaded.”, { “OK” } )

            end

        end

    end

     

    – photo uploading requires the “publish_stream” permission

  facebook.login( fbAppID, fbListener, { “publish_stream” } ) 

[/lua]

For Android, nothing has changed. For iOS changes made to build 1028 require an extra FB application ID in the build.settings file. You will find this in the Facebook sample code shipped with the latest Daily Build. It’s also been mentioned here on the forums.

 

If you are still having problems, file a bug report with a complete Corona project that’s failing. Include build information, device type  and steps to reproduce the problem.

Thanks Tom,

 

Just to be clear :

 

I didn’t change anything in the sample, except i filled my App id (on build.settings, and in main.lua) (and i also add FacebookAppID = “YOUR_APP_ID” in build.settings).

Then i clicked on post photo and it doesn’t work.

 

The way i explained it could look dumb, but it’s the only way that i found to prove that something is not working.

Yes i had all the information included in my build.settings that was needed.  

 

i know you just did Widgets 2.0 and right behind that was Network 2.0.   Could something in the network 2.0 be affecting this?  I will submit a bug report.

 

I just posted this as a bug report:  : (Case 21676) Facebook not posting pictures.  I could NOT strip my project down small enough to get it to upload the whole project since your website  only allows for a 10mb attachement.  So i supplied a link to my full project in a zip file from my server.

Corona, I just ran into this bug, in my case I am posting text. Is there a status of the bug (Case 21676) ? There does not seem to be a central place on corona’s web site that you can look through these bug reports???  Its getting pretty frustrating to keep running into these and spending lots of time searching for the solution… Is there a work around to this bug?  If corona posted a known issues area then we could see this kind of information instead of bugging you guys. 

BTW, I tried to update to the latest daily build to see if it was fixed and there are now massive java errors in every widget popping up in LuaLoader (android on device). I can print a couple of them if this is news to you.

Thanks,

Mike

Corona, I just ran into this bug, in my case I am posting text. Is there a status of the bug (Case 21676) ? There does not seem to be a central place on corona’s web site that you can look through these bug reports???  Its getting pretty frustrating to keep running into these and spending lots of time searching for the solution… Is there a work around to this bug?  If corona posted a known issues area then we could see this kind of information instead of bugging you guys. 

BTW, I tried to update to the latest daily build to see if it was fixed and there are now massive java errors in every widget popping up in LuaLoader (android on device). I can print a couple of them if this is news to you.

Thanks,

Mike