Did Facebook ShowDialog stop working all of a sudden?

Hey,

I’ve had the showDialog feature working in my apps for a while on both Android and IOS. But all of a sudden last week, I noticed facebook giving an error. I’m using build 2013.1217.

I’m using the facebook class:

cFacebook = require "facebook"

After connecting, I call the following:

cFacebook.showDialog(“feed”, {

  app_id = “555555555555555”,

  caption = “Download for Free”,

  description = “asdf”,

  link = “https://www.google.com/”,

} )

It gives me a

"An error occured. Please try again later.

API Error Code: 1

…etc"

Has anyone else gotten this?

Suddenly I have got similar error. Again and again  

For the Corona team it’s probably best to list what version of Corona you’re currently using.

I presume you’re using a Facebook library or have wrapped the functionality yourself? cFacebook?!?

Facebook is constantly evolving it’s login requirements.  They had a breaking change, that went into effect on Feb 1 that requires a different login process.  You need to either move to Graphics 2.0 build 2100 or later, or download this special Graphics 1 build found in this blog post:  http://coronalabs.com/blog/2014/01/29/apples-ios-7-submission-requirements/

It has a link to a special build 1262 which is a patched 1260 with a couple of important Facebook fixes.

Rob

I have since upgraded to v2013.2100 but am still getting the same error. Is there anything other uninstalling and then downloading the build that I am missing?

Do you have the native facebook app installed on your device?  I’m guessing based on the screen shot this is android.  Do you have any messages in your console log (adb logcat) that’s related to it?  Are you sure your hash key is setup correctly and that your other settings on developers.facebook.com are correct?

Here are the stats:

  • Native Facebook installed.
  • Android Motorola Razr
  • Logcat is as follows:
    • On Facebook listener, I get the Session callback with event.phase = “login” telling me I’ve logged in correctly. 
    • When I send the request for the Dialog, it gives me the screen I originally posted. When I hit ok, I get a event.type = “dialog” message with event.response = “fbconnect://success”
  • This uses the same code as before Feb that would post to facebook.

Can you post more of your code, in particular where you are logging into facebook?

Rob

cFacebookAppID = “555555555555555”

cFacebook = require “facebook”

cFacebook.login( cFacebookAppID, MyFacebookListener, {“publish_stream”} )

tried this too:

    cFacebook.login( cFacebookAppID, CFacebook.Listener, { “publish_stream”, “publish_actions” } )

What does your MyFacebookListener function look like?

function CFacebook.Listener( event )

    local self = g.m_facebook

    if ( “session” == event.type ) then

        print( "FB Listener - Session - ", tostring(event.response) )

        --options are: “login”, “loginFailed”, “loginCancelled”, or “logout”

        if ( “login” == event.phase ) then

            print(“Facebook Login”, event.token, event.expiration)

            g.MiscData.ConnectToFacebook = true

            CLog.LogEvent(“Connected”, { Type = “Facebook” } )

            self.m_accessToken = event.token

            self.m_expiration = event.expiration

            self.IsConnected = true

            self:RefreshFacebookIcons()

        else

            print(“Facebook Logout”)

            self:Logout()

            g.MiscData.ConnectToFacebook = false

        end

    else

        print( "FB Listener - “,tostring(event.type),” - ", tostring(event.response) )

    end

end

CFacebook.Logout is here:

function CFacebook:Logout()

    cFacebook.logout()

    self.IsConnected = false

    self:RefreshFacebookIcons()

    g.MiscData.ConnectToFacebook = false

end

If I add the following to lines:
print( "isError: " … tostring( event.isError ) )
print( "didComplete: " … tostring( event.didComplete ) )

I get:

isError: false

didComplete: true

for the connect and dialog calls.

Can you try this:

cFacebook.showDialog("feed", {   caption = "Download for Free",   description = "asdf",   link = "https://www.google.com/", } )

Thanks Rob!

I found the problem! For some reason, facebook will throw an error when you try to link to the google play store or the itunes store. So the following link threw that error:

https://play.google.com/store/apps/details?id=com.mygame.www

But, linking to your own personal site works just fine.

Suddenly I have got similar error. Again and again  

For the Corona team it’s probably best to list what version of Corona you’re currently using.

I presume you’re using a Facebook library or have wrapped the functionality yourself? cFacebook?!?

Facebook is constantly evolving it’s login requirements.  They had a breaking change, that went into effect on Feb 1 that requires a different login process.  You need to either move to Graphics 2.0 build 2100 or later, or download this special Graphics 1 build found in this blog post:  http://coronalabs.com/blog/2014/01/29/apples-ios-7-submission-requirements/

It has a link to a special build 1262 which is a patched 1260 with a couple of important Facebook fixes.

Rob

I have since upgraded to v2013.2100 but am still getting the same error. Is there anything other uninstalling and then downloading the build that I am missing?

Do you have the native facebook app installed on your device?  I’m guessing based on the screen shot this is android.  Do you have any messages in your console log (adb logcat) that’s related to it?  Are you sure your hash key is setup correctly and that your other settings on developers.facebook.com are correct?

Here are the stats:

  • Native Facebook installed.
  • Android Motorola Razr
  • Logcat is as follows:
    • On Facebook listener, I get the Session callback with event.phase = “login” telling me I’ve logged in correctly. 
    • When I send the request for the Dialog, it gives me the screen I originally posted. When I hit ok, I get a event.type = “dialog” message with event.response = “fbconnect://success”
  • This uses the same code as before Feb that would post to facebook.

Can you post more of your code, in particular where you are logging into facebook?

Rob