Facebook API and Open Graph v2 issues

Thanks for confirming. Most appreciated.

I can confirm that its working correctly for me now too, cheers.

Just saw this listed in daily build 2298 

  • iOS: Fix the Facebook plugin’s isPublishPermission unrecognized selector error.

This is just a plugin update so I will still get it when I rebuild my app on 2275 right? 

The sample Facebook app shows the web based login window, although I have the latest Facebook app installed?

This is on iOS.

Corona. Congratulations on breaking the Facebook implementation again. For the 20th time or so. Our support is now flooded with tickets; No one can log in with Facebook if they do a clean install. The users that don’t delete the current version before updating can log in just fine - they have the Facebook session token available. So the issue is only with clean sandboxes.

I have done some testing - like I’ve done for you every time you’ve broken Facebook - and it took me 1 whole minute to see that starting from your changes in build 2292 and ever since it’s not possible to log in with Facebook. I did an extremely hard to set up test - I ran my build using the amazing Xcode Simulator! Have you heard of that? You should take a look, it’s shocking how easy it is to test things using that simulator.

If I go back to 2289 and run my build, it works just like it should.

I can’t find ONE single time you have done a Facebook SDK update that went well. It’s always several weeks with bugs, ignorance and fumbling in the dark. And it’s always because your team don’t test properly. Amazed that you still haven’t learned that when you touch the Facebook SDK, you are in deep shit and need to do proper testing.

Haakon,

thank you for posting this. I have posted a thread about big issues with the new Facebook but got no response from Corona.

Till today I have lost hours an hours trying to make it work, finally I gave up and decided to wait to see if others will have issues, I thought maybe I am crazy.

We were ready to ship our new game but now we are stuck…

Hi Guys,

Same issues for us.

This is a blocker.

If we use the facebook graph api explorer it works properly.

https://www.facebook.com/v2.0/dialog/oauth?response_type=token&display=popup&client_id=xxxxxxx&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer%2Fcallback&scope=user_birthday%2Cuser_friends%2Cemail%2Cpublish_actions

if we asks for the extended permissions throught corona it doesn’t work.

facebook.login( self.fbAppID, onLoginComplete, {“publish_stream,email,user_birthday,user_friends”} )

We are asking to the cornona staff to have a look at it because we need to release or roll back to the corona stable release and use v.1 facebook graph apis.

Thanks in advance.

Filippo

@filippo - its already fixed, if you’ve recompiled since the 7th of may then you shouldn’t have the problem.  Don’t forget you actually need to make 2 requests to get extended permissions the first time for a new user, an initial login first, then check what permissions are missing and then a second login call with the missing permissions as params. 

@cjorgens79, do you have an example of this you could post please?

Thanks,

Ed

No, it’s not working, even though we’re asking only for email:

facebook.login(id, listener, {“email”})

No extended permissions required on login.

Did you try making 2 logins? (The first one without any extended permission, and then on the second one you request the extended permissions)

So you mean we should first login like this

facebook.login(id, listener)

and then

facebook.login(id, listener, {“email”})

when the first login returns?

That is indeed not the intention by Facebook. They require 2 logins if you need _extended_ permissions, as in being allowed to post on the behalf of the user etc. Our login simply asks the user to allow us to get his email address, and that is not extended permissions.

Yes, try that.

I had that problem in an app and this solution worked for me.

I did some testing with build 2300 and the Facebook sample app and I’m not sure what you’re seeing when you say it’s broken. I was able to log in to Facebook and post a message. I tested this on an actual device (iPhone5 running iOS7).

Please use the bug reporting forms so we get the bugs in our system. We can’t track bugs that are posted in the forums.

We need to know the device you’re testing on; the OS version; if you have the Facebook app installed; and the steps to reproduce the problem and the results you’re seeing. If the bug can’t be reproduced with sample Facebook app, please attach a complete zipped test project that we can use to reproduce the bug.

Thanks,

Tom

@haakon - Email is indeed an extended permission, if you log into the FB dev portal, goto graph explorer, then click Get Access Token then click on the Extended tab you will see the email permission there. You need to do a second login asking for email permissions once the first login has succeeded.

Did you try what I described in this thread? (tested with your sample app)

http://forums.coronalabs.com/topic/47694-facebook-nasty-bug-checked-with-your-facebook-sample-app/#entry246845

Hi,

I’m looking into this now. I found one breaking change - doing a request for /me with fields specified throws an error. The username field is deprecated in the new facebook graph api. Our app was relying on the Facebook username. I have changed that now to rely on the first_name instead and it works.

So - this does no longer work: facebook.request("/me", {fields=“username”}).

That is not Corona’s fault. But if you could please return some usable error messages, and not just com.facebook.error 5 or whatever it says, things would be A LOT easier. As it is now, everything regarding Corona + Facebook debugging is a huge guesswork.

I have one more issue with getting specific fields for /me/friends, looking into that now.

@Haakon - if your after the full name you can use “name”. If you need something unique to keep track of, use the facebook "id’ field which you get back with every query from memory. The FB Graph Explorer is extremely useful for quickly and easily testing your queries and seeing what data you can get. 

I am confused now. This is on Android.

Using latest daily build 2300.

One login request:

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

and in the login event.phase

local params = {fields = “id,username”}
facebook.request(“me”, “GET”, params)

and this works! I am getting the username!?

From what daily build is Corona using Facebook v2 ?

If you login to facebook with a user who you have previously logged in with and allowed extended permissions, everytime you login you will be automatically given those same permissions. The only time the second login is really required is for first time use for a new user or when you ask for permissions you have never asked for before. 

A developer can use either the old or new versions as they have just changed the url scheme. Im not sure however what the facebook.request function does, it may now automatically append the v2 url scheme, someone from corona would have to weigh in on that. I dont personally use facebook.request however, i use network.request instead which gives me more control of the url and listeners. 

If you make use of the old api version then the old username option would still work, however the old api will be deprecated in 12 months, so you are better off using the v2 api as this has a 2yr life from the point they release 2.1 or higher. After which point any calls are automatically pushed up to the next non-deprecated api version.