Facebook frustrations

Hi Rob,

thanks for your reply.

I could not figure out any changes with the latest daily build. Currenty I am testing on Android.

Based on the current Facebook policies we should enhance the showDialog() function with the ability to upload a photo from the app including some nice text.

Why? Facebook does not allow to upload a photo with autogenerated text directly from the app, even if the user has the chance to edit the text in the app!

For everyone why just want to upload a photo to the users wall the followong code works fine (do not forget the permissions {“publish_actions”, “user_photos”}  on login):

local attachment = {source = {baseDir="photo\_dir", filename="photo\_file", type="image"}} facebook.request("me/photos", "POST", attachment)

You can also add the “name”-property to set a message - works perfectly but no go  from Facebooks review team!

So, we need someting like this to pass Facebooks App Reviews to upload a picture to users wall including some text per Facebook embedded dialog:

facebook.showDialog( "feed", {redirect\_uri = "www.website.com", link = "www.website.com",             picture = { baseDir=msg\_photo\_dir, filename=msg\_photo\_file, type="image" },             name = "name", caption = "Caption", description = "Description"})

Rob, I hope this description helps so far? Do you think your Team can handle that?

Best regards

   Chris

Hi Guys,

For allowing user to like game’s Facebook page, we redirect user to respective face book page through browser. Now, here comes the problem.

If I am logged in to facebook’s native app through LOGIN A and on browser through LOGIN B, after redirecting to browser and liking the page the like information will get displayed on the timeline of LOGIN B instead of LOGIN A. The opposite of which should be the case. 

Is there any provision to open facebook’s URL with native logged in user’s id?

Please Help.

Regards and Thanks

Any suggestions on this?

Four days, I have tried everything!

Thank you

Hi @felipebotero.  You posted this on a Friday.  Here in the US, most people work Monday-Friday, but this week, Monday was a holiday.  Today is the first day that Engineering would have a chance to have even seen my message.  Please be patient.

Rob

I apologize, I’m desperate with this problem. 

I’ll be waiting patiently … :slight_smile:

Have you tried calling facebook.logout() and then try logging in again to see if you can re-prompt them?

Yes, I already tried that… but permissions are not prompted again.

As I said before, this is a new “feature” since Facebook API 2.0, more info here:
https://developers.facebook.com/docs/facebook-login/permissions/v2.1#handling

At this moment, I think there is no way with corona to make that call…
I’m using GET /{user-id}/permissions endpoint too, to obtain which permissions has been granted.

But there is no way to do this auth_type: ‘rerequest’ call.

regards
 

Hi Rob… any news on this?

Thank you

No news that I’ve heard. 

Rob

Hmmm

I might be missing something, but you can get permissions using Corona:

facebook.request("/me", "GET", { fields = "permissions" })

Don’t shoot if I lost track of something in this thread :wink:

Yes, permission status can be obtained this way… but if some of them are explicity “denied”, there is no way to make a new login call with auth_type: ‘rerequest’ param… like facebook documentation states.

regards.
 

Hi everyone!

I’m not completely sure if this is something Facebook specific or is just about the configuration of the project but, is it possible NOT to show Facebook app login screen when login from an app?

In the project I’m working, once the user had logged to Facebook, the “autologin” feature is on, so it will automatically login to FB at the title screen when launched, but I want in that case NOT to switch to Facebook app (or browser) when it happens (it opens Facebook app, login and go back to app) . Is there any way to avoid this? Is something Facebook related or is about app configuration?

Thanks a lot!

I’m simply just trying to post a score.
When I use the Social plugin for facebook it works for iOS. On Android I get a “share via list” with no facebook option. I’ve searched to put facebook on list to no avail.  When I use the Facebook library it work for older androids but newer androids get error message that app is not installed correctly. Re-installing FB, accepting all options does not help.  Your sample FB app behaves the same way for me.  Is this common at this time for FB,
 
function showFacebook()
        local gameScore = score.get() —getScore()
        local FBAppID = “removed for example”
        local buttonClickSound = audio.loadSound(“SoundButtonClick.wav”)
        audio.play(buttonClickSound)
        fbbutton.isVisible = false      
        local options = {
            service = “facebook”,
            message = “Just Scored  " … gameScore … "  on ----------  V1 Beta !!!”
            image = {
                { filename = “HBpic.jpg”, baseDir = system.ResourceDirectory }
            },
            url = “”
        }      
        native.showPopup( “social”, options )
    end
 
Where can I find a working snippet just to post a score on FB that works on iOS and Android reliable?
 
 
By the way, you guys are great. I appreciate the work you put into this.

@sajoga I’m not aware of a way to avoid the facebook login prompt.

@Skartechnologies, the social plugin does not work on Android for Facebook.  Its a known Google/Facebook issue.  You will need to use the Facebook API there to do this.  What do you mean by “Older androids” and “newer androids”?

Rob

Hi Guys,

I am making a game for iOS. I have integrated Facebook login and score share functionality in this. I have a problem that if I login my game through facebook’s developer id and click fb button to share score, login works well and score share also works perfectly fine with showDialog() function.

But if I use any other Facebook account to login, login goes fine but score share crashes and gives me following error in crash log:

 

    The operation couldn’t be completed. (com.facebook error 123.) corona

 

Please help. Urgently need some help. Thanks in advance.

Did you submit the app to Facebook for review?  Before anything can be posted to FB, tehy review the app and then approve the permissions you need.  For the developer account, it works.

Hello.my problem is that when I try to log in to facebook sometimes it works but most of the time it freezs then a min later it crashes plz help
Corona build.2014.2393
Android 4.4.2
Facebook operation: log in so I can make a score leaderboard of friends on facebook
Permission needed: user_friends. Public_profile

Hello.my problem is that when I try to log in to facebook sometimes it works but most of the time it freezs then a min later it crashes plz help
Corona build.2014.2393
Android 4.4.2
Facebook operation: log in so I can make a score leaderboard of friends on facebook
Permission needed: user_friends. Public_profile

Hi @marc.jd,

Can you please provide more details and some code, and ideally an error messages you’re getting in the console error dump? We’ll need more information to help assist you.

Thanks,

Brent

ok so i cn log in just one time then it freeze again after i log out or cancel the login

build setting.

 

[lua]

-----build setting-------------

 

settings =

{

   orientation = 

   {

      default = “landscapeRight”,        supported = 

      {

         “landscapeRight”,“landscapeLeft”

      },

   },

 

   android =

   {

      googlePlayGamesAppId = “XXXXXXXX”,

      usesPermissions =

      {

         “android.permission.INTERNET”,

      },

   },

 

   plugins =

   {

 

      [“facebook”] =

      {

         – required

         publisherId = “com.coronalabs”,

         supportedPlatforms = { iphone = true, [“iphone-sim”] = true },

      },

   },

 

   plugins =

   {

      – key is the name passed to Lua’s ‘require()’

      [“CoronaProvider.gameNetwork.google”] =

      {

         --required!

         publisherId = “com.coronalabs”,

         supportedPlatforms = { android = true }

      },  

   },

}


[/lua]

 

so the fcb_leaderboard is a scrollview in wich i will add scores of friends after the log in and the facebookconnect integer is to see if user logged in so it will be saved as 1 so each time the app start it will log in to Facebook automatically 

 

[lua]

------------code—

local facebook = require( “facebook” )

local json = require( “json” )

local fbCommand = nil

local appId = “XXXXX”

 

 

 

function changemenu3()

    facebookconnect = 1 

   local facebookconnectFilename = “facebookconnect.data”       

  saveValue(facebookconnectFilename, tostring(facebookconnect) )

  connect_fcb.y = 100

  connect_fcb:prepare(“disconnect”)

  connect_fcb:play()

  fcb_leaderboard.x = 132

  cb_leaderboard.y = 270

end

 

 

function facebookListener(event)

  print( “Facebook Listener events:” )

 

            –

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

            – event.phase is one of: “login”, “loginFailed”, “loginCancelled”, “logout”

–                    statusMessage.textObject.text = event.phase – tjn Added

 

                    print( "Session Status: " … event.phase )

 

                    if event.phase == “login” then

                      if(facebookconnect==0)then

                            changemenu3()

                          end

                    end

                    if event.phase == “logout” then

                    end

                    if event.phase == “loginFailed” then

                      function cancelfcbalert(event)

                        if(event.action==“clicked”)then

                          if(event.index == 1)then

                            native.cancelAlert( alert )

                        end

                      end

                      alert = native.showAlert( “”, “Facebook login error. Check connection or try again later.”, { “Done” }, cancelfcbalert )

                    end

                  end

                    – The following displays a Facebook dialog box for posting to your Facebook Wall

                 

        elseif ( “request” == event.type ) then

            local response = event.response

 

        elseif ( “dialog” == event.type ) then

 

        end

end

 

 

function connect_tofcb(event)

    if(event.phase==“began” and gamestart==false)then

      if(facebookconnect==0)then

        facebook.login( “XXXXXXXXX”, facebookListener , { “public_profile”,“user_friends” }  )

    else

      function areyousurefcb( event )

       if(event.action==“clicked”)then

        if(event.index==1)then

          facebook.logout( )

          facebookconnect = 0

  local facebookconnectFilename = “facebookconnect.data”       

  saveValue(facebookconnectFilename, tostring(facebookconnect) )

  connect_fcb.y = 250

  connect_fcb:prepare(“connect”)

  connect_fcb:play()

  fcb_leaderboard.x = 132

  fcb_leaderboard.y = 2000

        else

          native.cancelAlert( alert )

      end

      end

    end

    alert = native.showAlert( “”, “Are you sure you want to disconnect from this Facebook account?”, { “Yes”, “No” }, areyousurefcb )

end

end

end

 

connect_fcb:addEventListener(“touch”, connect_tofcb )

[/lua]

 

please help