Facebook frustrations

Lord Jesus… It’s “apprequest s”, not “apprequest” :unsure:

One more thing. I guess it has to be configured in build.settings, but, how do I configure the Play Store url (or id) where the application is? With iOS, adding the iPhone/iPad Store ID in the Facebook app iOS configuration page is enough to download de app when a request is clicked. How do I configure the URL for the Andoid app?

Thanks one more time.

Hi, i see you managed to fix your issue with facebook.showDialog and apprequest.

I confirm apprequests is working for me as well.

I wonder, can you use properly the facebook.showDialog with feed?

Is it working?

Talking about Facebook Frustrations, this is one.

Managed to fix the issue of facebook.showDialog.

Came from a property in advanced setting of the facebook app dashboard.

http://forums.coronalabs.com/topic/49213-problems-to-implement-facebookshowdialog-yes-i-know-another-one/#entry254712

Hi,

I’m having headaches already…

Platforms: I’m having problems with both.

Corona SDK: 2014.2189 (2014.3.6)

Facebook operation: I’m trying “apprequest”, but it’s not working. I only got “the page you requested was not found” message.

Friend list when i use the “showDialog(“friends”, onComplete)” it’s empy.

Login, logout and self publishing works fine. 

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local facebook = require("facebook") local widget = require("widget") --ID de la aplicación local FBAppID = "521039174688673" local function onComplete( event ) print("event.name:", event.name) print("event.type:", event.type) if (event.data) then print(" { ") for k, v in pairs( event.data) do print(k, " : " , v) end print(" } ") end end local function listener( 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 ) ) if ("session" == event.type) then if ("login" == event.phase) then facebook.showDialog("apprequest", {message="Prueba de invitación"}) end elseif ("dialog"==event.type) then print(event.response) elseif ("request" == event.type) then print(event.response) end end -- muestra amigos local function showFriends(event) if (event.phase =="ended") then facebook.showDialog("friends", onComplete) end return true end -- Ventana emergente para publicar en el muro local function publishFeed( event ) if (event.phase == "ended") then --facebook.request("me/feed", "POST", {message="Probando librerias de FB para Corona. Disculpen las molestias"}) facebook.showDialog("feed", {message="más pruebas de desarrollo"}) end return true end -- peticion de instalacion local function appRequest( event ) if (event.phase == "ended") then facebook.showDialog("apprequest", {message="Probando a invitar amigos..."}) end return true end -- login en facebook local function login( event ) print("---------------- entrando en método de login") if (event.phase == "ended") then --login facebook.login(FBAppID, listener, {"publish\_actions"}) print( "------------------- login realizado" ) --Registro de instalación en la web print ("------------------- registrando instalacion") facebook.publishInstall(FBAppID) print( "------------------- registro realizado" ) --buttonFriends:setEnabled( true ) --buttonPublish:setEnabled( true ) --buttonAppRequest:setEnabled( true ) --buttonLogin:setEnabled( false ) end return true end -- logout local function logout( event ) print("---------------- entrando el el método de logout") if (event.phase == "ended") then facebook.logout( ) print( "--------------- logout realizado" ) end return true end -- elementos de la interfaz local buttonLogin = widget.newButton{ label = "Login", onEvent = login, x = display.contentCenterX, y = display.contentCenterY - 120 } local buttonLogout = widget.newButton{ label = "Logout", onEvent = logout, x = display.contentCenterX, y = display.contentCenterY + 120 } local buttonFriends = widget.newButton{ label = "Elige amigos", onEvent = showFriends, x = display.contentCenterX, y = display.contentCenterY - 40 } local buttonPublish = widget.newButton{ label = "Publicar en mi muro", onEvent = publishFeed, x = display.contentCenterX, y = display.contentCenterY + 40 } local buttonAppRequest = widget.newButton{ label = "Peticion", onEvent = appRequest, x = display.contentCenterX, y = display.contentCenterY + 80 }

And build.settings

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend FacebookAppID = "521039174688673", -- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fb521039174688673", -- example scheme for facebook } } } } }, --Prueba de facebook plugins = { ["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = {iphone=true, ["iphone-sim"]=true}, }, }, -- Android permissions androidPermissions = { "android.permission.INTERNET", }, }

Thanks.

Lord Jesus… It’s “apprequest s”, not “apprequest” :unsure:

One more thing. I guess it has to be configured in build.settings, but, how do I configure the Play Store url (or id) where the application is? With iOS, adding the iPhone/iPad Store ID in the Facebook app iOS configuration page is enough to download de app when a request is clicked. How do I configure the URL for the Andoid app?

Thanks one more time.

Hi, i see you managed to fix your issue with facebook.showDialog and apprequest.

I confirm apprequests is working for me as well.

I wonder, can you use properly the facebook.showDialog with feed?

Is it working?

Talking about Facebook Frustrations, this is one.

Managed to fix the issue of facebook.showDialog.

Came from a property in advanced setting of the facebook app dashboard.

http://forums.coronalabs.com/topic/49213-problems-to-implement-facebookshowdialog-yes-i-know-another-one/#entry254712

Hi,

I’m trying to get all the apprequests of my application, but it seems that facebook.request( “me/apprequests”, “GET”, {fields="…"} ) gets all apps pending requests.

I know I can set the field ‘application’ and compare results to get only the ones with the same id of my app, but I want to know if I can retrieve only my app’s pending requests.

Thanks a lot!

Hi,

I’m trying to get all the apprequests of my application, but it seems that facebook.request( “me/apprequests”, “GET”, {fields="…"} ) gets all apps pending requests.

I know I can set the field ‘application’ and compare results to get only the ones with the same id of my app, but I want to know if I can retrieve only my app’s pending requests.

Thanks a lot!

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

Hi @marc.jd,

According to your code, you have 2 “plugins” blocks in your build.settings. So you’re not including the Facebook plugin at all, because you overwrite it with the “gameNetwork-google” one. Please correct this and test some more.

Best regards,

Brent

Hi Brent,

Did you get chance to look at my problem above? For your ready reference, I am attaching it here:

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.

 

Please provide some solution in urgent.

Hi @appstore3, you need to provide more information than I’m having a problem.

What version of Corona SDK are you using?

What platform are you building on?

What device are you building and testing on?

What messages are in your device’s console log beyond the one you published?

Have you googled what com.facebook error 123 means?  There will likely be plenty of hits on that on Stackoverflow from other platforms that might give you a hint as to whats going on.

Have you read @schizoid2k’s post above?  Generally if it works for your developer account, but not someone else’s, then your app is considered a test app and will only work for your defined test accounts.  Facebook has seriouslly restricted what apps can do on their service and apps that need extra features are required to be approved by Facebook before you can get those features. 

Rob

Hi Rob,

I have a problem with facebook v2 login flow with extended permissions.

There are 4 states:

  1. User has no permission
    I can ask user to give permissions to app, throug facebook.login function().

  2. User accept basic info, but “skip” extended permissions
    I can ask user again to give permissions to app, throug facebook.login function().

  3. User accepts basic/extended permissions
    All works fine.

  4. In API v2, facebook introduces possibility to “deny” permissions to app (Different from skip). <-- PROBLEM
    In this case, in the Facebook API there is a param called “auth_type: rerequest” that need to be sent in login process, so app can aks user for those permissions again.

Currently, is there a way in corona to do that “rerequest”?
I have tried everything, denied extra permissions are never asked again.

Sorry for my basic english.
Thank you

hello am trying to do a friends score board in a corona game so i have some questions

how to decode friends score with rank and name once requested as facebook.request( appID … “/scores”) and does this request givethe signed in user his score too ??

Hey Andrew, hey Rob,

I totally agree with Andrew. Most of the problems are confusions in how to handle the API correct.

Additionally there are so much libraries that handle the API wrong, too or just for a certain purpose.

I learned the ropes in the API handling to write my own Facebook code and could get everything work - except the image upload with an additional message, as described in my blogpost: http://forums.coronalabs.com/topic/51699-post-photo-to-facebook-using-facebookshowdialog/

In a nutshell: Uploading images works with the request() function, but Facebooks current policy does not allow to add a message / text to the photo. The only chance we have to give the user this feature is to enhance the ShowDialog() with positng images, because adding messagen “in Facebook” is allowed.

@Rob Miracle: Do you see a chance to get this implemented?

Best regards

   Chris

Can you try again, I know we just did a fix to the Facebook plugin around image handling yesterday or the day before.  If not, I can ask engineering to see what can be done about it.  If it’s not too difficult, they might be able to address this now that we are kind of coming out of this iOS 8 crunch mode we are in.

One of the problems is that Facebook changes their rules too fast and it takes considerable engineering and support efforts to stay atop their changes.   We know a lot of people use Facebook, but we have to balance the engineering time to all the other things we do too.  So no promises.  See if the new plugin fixes this and if not, bump this and I’ll talk with the engineers.

Rob