Hi Rob,
That would be great… I have not posted a bug report before… how should I go about doing that?
Thanks
Hi Rob,
That would be great… I have not posted a bug report before… how should I go about doing that?
Thanks
Put together a small sample app that demonstrates the problem. The app should include the build.settings you are using and a config.lua. Zip up the folder with files in it and then click on the link at the top of the page: Report a Bug.
Fill out the info, attach the zip file and submit it. You should get an email that has a bug report ID # in it. Please post that ID # back here afterwards so that we can follow up with it.
Rob
Hi Rob,
Thanks for the info… I’ve done all that and the number is Case 34216
Appreciate your time with this, thank you
Actually I’m dealing with a different facebook issue this morning, and while researching it, it seems that email and user_friends are not granted by default. They require a second login to get. What separates them from publish_actions and other write actions is that publish_actions and company require app approval before they will be granted, where as email and user_friends do not require approval. They still require the second login however.
Rob
Hi Rob,
I’m getting confused between what is required by facebook and what the plugin is doing…
Do you mean that facebook itself requires you to do two logins? if so, can you point me to where in facebook documentation it says this as I can’t find where it states that?
Or do you mean, the corona plugin requires you to do two logins? if this is the case, then I agree that doing it twice is currently the way to get the plugin to “work” (for email and friends). However, I don’t believe that this should be the case from what I have read from the facebook documentaion.
From the fb docs, I also agree that you do require approval for any publish type permissions. Although you get public_profile by default, the docs say that you can ask for additional read-only (i.e. email) permissions at first login.
Lets take publish out of the equation for now as this seems to complicate things further - I’m just interested in getting the correct facebook login to appear first time i.e.
https://drive.google.com/file/d/0Bzgfv3d10ZJ_VHIwU3NfQXktTlE/edit?usp=sharing
Sorry to keep quoting the facbook documentation but I can’t help but feel something isn’t quite right with the way the plugin works (for read only permission)… However, Im more than happy to be proved wrong if you can tell me technically why the corona plugin needs to do two logins i.e. where does facebook state this? It’s also quite likely that I’m just missing something that you guys have not but if you could just point me in the right direction, I’ll shut up and leave you alone haha
This is from the iOS SDK page (I assume this is what the corona plugin uses?)
_" Requesting permissions at login _
When someone connects with an app using Facebook login, the app can access their public profile and friend list, the pieces of information that are visible to everyone. To create this basic connection, apps must always request access to a person’s public profile information by asking for the public_profilepermission. Similarly, all other pieces of information that someone adds to their Facebook profile are secured behind other read permissions. Apps also need publish permissions in order to post content on the user’s behalf. If you want to know more about permissions, you can check out ourpermissions reference.
_ You can ask for any number of read permissions or for publish permissions during login. However, as a general rule, the more permissions an app requests, the less likely it is that people accept the permission request and continue with the login process. Our research shows that apps that ask for more than four permissions experience a significant drop off in the number of completed logins. Requesting publishing permissions with publish_actions during login will prompt a second step in the login UI , as they have their own publish permissions request screen that’s shown after the login screen, which can cause fewer people to log in. As a result, we suggest that you request the bare minimum of read permissions during login and then request any additional or publish permissions when a person actually needs them."_
I grabbed this from this page:
The way I read it is that for read only permission you only need one login - for publish you need two
https://developers.facebook.com/docs/facebook-login/ios/v2.0#permissions-login
Hi Rob,
Just wondered if you had chance to read my last post?
I also got a response back about the bug I logged (34216) from Tom saying that “There have been a number of Facebook fixes in the latest Facebook SDK that was added to a Daily Build” - however I thought that because facebook for ios is a plugin it is not affected by daily builds?
I also asked Tom what changes (in particular my issue) had been made but as yet I’ve had no response. Do you know if this issue was part of the fixes?
Cheers
On iOS it’s a plugin and should not be dependent on daily vs. public builds. However on Android, its still in the core and the daily build matters.
I spent a lot of time reading the Facebook API docs around login and permissions, and while the first long probably should allow you to ask for email and user_friends, it’s not wrong to do it in two passes. I’ll reply to the bug, and add some context to it, but it seems to me that you can do the two logins and still work. Facebook is very clear that you should ask for public_profile first and then ask for other things when you need them.
Rob
Hi rob, thanks for taking the time to read the facebook docs - its appreciated. I too have spent a lot of time reading it all but feel it was time well spent. Yes, you are 100% correct that it is not technically wrong to do it in two phases however, why do something in two steps that you can do it one?
I guess the point I was trying to get across is that the user experience is much much better doing it just once. I suppose me calling it a bug is a bit of a misnomer too - more of a “it would be way way better for the end user if it worked in this way”…
If facebook said that it absolutely had to be done in two phases then that is out of your control but as you mentioned… facebook does allow you to ask for multiple read only permissions as first log (even though it recommends doing public profile first - its not mandatory) so really corona should allow you (the developer) to do that also if you choose to.
Anyway, thank you very much for listening to me bang on about this haha! and thanks for updating the bug on my behalf.
As you said, it does still work but it is clunky so I’ll cross my fingers I hope it gets resolved…
Would it help if I promised to upgrade to PRO once the bug is fixed plugin is enhanced?? ;) I actually would
Cheers
Dave
Hi Rob,
I noticed that android has now moved to be a plugin (in daily builds) - does that mean that my original issue with the double login is now resolved for android?
Also, as part of those changes did the second issue (case num 34943) get looked at?
Cheers
I have no idea if the double login problem is solved. The bug itself is still being investigated. I know the Android plugin is using the latest sdk to get past an AdMob problem.
I’ve not had a chance to try and build any facebook apps since those changes.
I just wanted to say that I’m with Dave on this, not that the plugin is broken, but having a two-phase login seems like bad user experience to me and it would be nice if it could work the way Facebook states how all read only permissions can be asked for in the first step.
I’m having issues with my users because they accept the public profile, but then when they are brought to Facebook a second time it asks for the friend list, it seems they are declining it. My app REQUIRES friend list so it confuses the user why they can’t log in, even though they did allow access to Facebook. I can pop up alerts explaining to the user why they cant log in but again, bad user experience.
It would just be nice if the outcomes could just be:
A ) not login and give facebook no permissions
or
B ) login and give facebook both permissions
But the way it is implemented now opens up a whole new outcome:
C ) login and have a missing permission
I don’t want the user to be even logged in at all if they have the missing friend_list permission.
As a side note because the publish_actions is not the topic in the forum, I do ask for the publish_actions permission later on in the app when the user is asked if they would like to share a post, and that works nicely because its an optional permission in my game.
Love to know if this is something still being looked into.
Thanks,
Evan
Ps I do have a PRO account
Hi Evan,
Thanks for chipping in - i was beginning to think it was just me that was thinking this… can I ask - have you read all the facebook docs too? is that how you came to the same conclusion I did?
As you said, its not that the plugin in broken per se - its just the (unnecessary) bad user experience it seems to give.
I would imagine this is low on corona’s list since it does “work” but it would be great if they could just tweak the plugin for us
I did raise a bug but no idea what the progress is or whether it has been considered a non issue, etc… Don’t suppose you know where the page is for checking where a bug case is at?
Cheers
Yes, I read all the Facebook documention and that is what led me to this forum. I figured there must be someone else finding this a problem, but it seems it might only be us.
The problem is it doesn’t seem to be reliable calling this line at all:
facebook.login( appId, callFacebook, {"public\_profile", "user\_friends"} )
But instead what seems to fix my users issues when logging in is using the plugin like this
facebook.login(self.fbAppID, facebookListener, {'public\_profile'} )
Then once Facebook returns the login worked, call
facebook.login(self.fbAppID, facebookListener, {'user\_friends'} )
It seems that sometimes, not sure what my user’s are doing, it wont even ask again for user_friends the first way and that is what is preventing them from logging in. The weird thing is, give it a day or 2, the users can successfully log in to Facebook with no change to their privacy settings on Facebook.
According to this document, http://docs.coronalabs.com/daily/guide/social/implementFacebook/index.html, the first way should work.
Sorry Dave, I’m not sure how to check the progress on a bug case.
Can someone try this now? Engineering said they fixed this in the plugin today.
Rob
Rob - what a legend! :)
I just deleted my app from facebook, rebuilt my app, logged in with facebook and the very first time I get public profile, friend list AND email!! The process feel so streamlined now!
Really appreciate you getting someone to look at this, Rob. I know this was probably a low priority given all the other things you are no doubt working on but this is a massive improvement for the facebook plugin.
Maybe if Evan could check things in his app too (just in case I’ve done something wrong) just to confirm but this is great news for me!
Anyway, next paycheck - looks like I’ll be upgrading my account haha
Is it cheeky to now ask if the same will happen for android ;) ? (appreciate that is part of the core so might not be quite as quick / easy)
Thanks again
This fix did not make it into the recent public build. Facebook is not a plugin on Android, so this will have to wait until daily builds resumes before we can apply this for Android… if it’s a problem there. It may be working already.
Rob
Works great now! :D Thank you so much Rob, Dave, and the Engineering team!
Might have spoke too soon. Is this the expected behavour?
The ‘Connect’ button is always calling:
facebook.login(self.fbAppID, facebookListener, {'public\_profile', 'user\_friends', 'email'} )
But every other time this code is executed it alternates from asking for only public profile (not what I want), to asking for all 3 (which is what I want), starting with only public profile.
Here’s a video to show the behaviour:
Can you post your login code?
Evan…
I watched the video - can you confirm that you are doing this (so I can replicate exactly the same process for comparison):
Ensure app has been removed from FB
Open app
click on connect - goes to FB with one permission requested
click cancel on facebook dialog - goes back to your app
click on connect - goes to FB with three permissions requested
etc, etc
If so, I will try the same but for me if I follow steps 1 - 3 the first display of the FB screen always shows 3 permissions now
I’m not at home now but I’ll post my login code too if that helps later on
Cheers
Dave
Okay I have more information. Hopefully this helps!
Ensure app has been removed from FB
Open app
click on connect - App logs in even though it was removed from facebook:
type=session name=fbconnect expiration=1413034972 phase=login token=CAAKMoE4EGGEBAFMZAUjVLhXEhmKqA1ZBZAN1nTUZCBDQTrfpEWWq9ju8XKCGOejaVqVPRO738UuDRgoBgbZAlwZAbwOVOwwPuzd2ZBoGfmQlbDzqqXTYQwvRVZAZCezIGZB3SQfEP71INogpJ3gX16sCSFZBcF4YotRZCNwB8myXuMwREQZBMUcp9cWfGcYdS9x3lxyaoyCjb2PgDO1kqZ isError=false response=nil
App understands that a login was successful and automatically calls facebook.request(‘me/permissions’)
Facebook listener returns:
type=session name=fbconnect phase=logout isError=false response=nil isError=true type=request name=fbconnect response=The operation couldn’t be completed. (com.facebook.sdk error 5.)
Since the app wasn’t apple to get permissions, it shows the connect button again.
Click on connect and because its the second login technically, it only shows the public_profile permissions
It seems that for some reason it still logins in (which it shouldn’t correct?), but once a new request is called it automatically logs the user out and returns the “com.facebook.sdk error 5”.
What am I doing wrong to get this. If this never occurs, I would be getting the results like Dave where it shows all 3 permissions first.
Here’s my code:
local function facebookListener( event ) if (User.state == 'login') then if event.type == "session" then if event.phase == "login" then User.fb\_sessionToken = event.token User.fb\_sessionExpiry = event.expiration User.onComplete() elseif event.phase == "loginFailed" then User.onError() end end elseif (User.state == 'permissions') then if event.type == "request" then local response = json.decode( event.response ) if event.isError == false and response~= nil then local missingPermission = true if (response.data ~= nil) then for i=1, #response.data do local data = response.data[i] if (data.permission == 'user\_friends' and data.status == 'granted') then missingPermission = false break end end end if (missingPermission == true) then User.onError() else User.onComplete() end else User.onError() end end elseif (User.state == 'me') then if event.type == "request" then local response = json.decode( event.response ) if event.isError == false and response~= nil then if (response.id ~= nil) then User.fb\_userID = response.id User.name = response.first\_name end if (response.email ~= nil) then User.email = response.email end User.onComplete() else User.onError() end end elseif (User.state == 'friends') then if event.type == "request" then local response = json.decode( event.response ) if event.isError == false and response ~= nil and response.data ~= nil then User.fb\_friends = response.data User.onComplete() else User.onError() end end end end function User:LoginToFacebook(onComplete, onError) local function checkPermissions() local function getMyInfo() local function getFriendsInfo() self.state = 'friends' local function loginToParse() local function loginSuccessful() self.isLoggedIn = true onComplete() end self.onComplete = loginSuccessful self.onError = function() onError() end self:doParseLogin() end self.onComplete = loginToParse self.onError = function() onError() end facebook.request( "me/friends" ) end self.state = 'me' self.onComplete = getFriendsInfo self.onError = function() onError() end facebook.request( 'me' ) end self.state = 'permissions' self.onComplete = getMyInfo self.onError = function() onError() end facebook.request( 'me/permissions' ) end self.state = 'login' self.onComplete = checkPermissions self.onError = function() onError() end facebook.login(self.fbAppID, facebookListener, {'public\_profile', 'user\_friends', 'email'} ) end
Also note, after the weird logout occurs, the steps in Dave’s post will always show all 3 permissions the first time like he is experiencing.