What is the code for your onError() function?
It’s just GUI calls like:
button.isEnabled = true activityIndicator:stop()
I don’t see where you’re calling login a second time.
seems to be a problem there too… for me at least
I don’t call login a second time. There is a ‘Connect’ button on my app that calls login. I press it the first time (step 3 in my earlier post), and then because it fails and gets a sdk 5 error, press it a second time (step 7) and it brings me to Facebook permission page but only showing public_profile permission.
The problem is when I delete the permissions through the Facebook app, and launch my game, it logs in successfully. However when I try a request after the login, the request seems to log out the user and return an error for the request.
This wouldn’t be an issue if every other login didn’t alternate between showing 3 permissions to 1 permission. Do you know why it does this?
Lets get a bug filed on it then. Produce a reproducible test case for engineering please. Make sure to include your config.lua and build.settings and put it all in a .zip file please.
Rob
Hi Evan / Rob
Sorry for delay in properly responding - I have been away from my pc most of the week so have only just started to do some tests.
I can confirm that I am also getting the weird switching between public profile only and the permissions I want i.e. email and friends.
I have also managed to replicate this with a very very minimal amount of code which I have posted below… I have a button that calls fbLogin(). This is the process to replicate
-
Ensure you have deleted the app from facebook
-
Open my app and click on my login button
-
Switches to facebook and shows the correct permission (public, email and friends)
-
Click ‘Cancel’ and return to my app - event phase is loginFailed which is fine since I cancelled
-
Click on my login button again
6) Switches to facebook again but now just shows public permissions
- Click ‘Cancel’ - repeat step 2
Evan (and rob if you have time) - can you confirm that you can replicate this behavior consistently using the bare minimum code below?
local function callFacebook2(event) print( "Facebook Listener events:" ) print( "event.name", event.name ) -- "fbconnect" print( "event.type:", event.type ) -- type is either "session" or "request" or "dialog" print( "isError: " .. tostring( event.isError ) ) print( "didComplete: " .. tostring( event.didComplete) ) print( "eventphase:", event.phase) end function fbLogin(event) -- login to facebook and then get user data facebook.login( appId, callFacebook2, {"email, user\_friends"} ) end
David, can you go ahead and file a bug report with your test case. Make sure to include the build.settings and config.lua and any assets needed and bundle in a .zip file.
Thanks
Rob
Sure thing Rob - I’ve just submitted that for you guys… Hopefully it will be something easy to fix
Case 34943
Cheers
Dave
It seems like Dave beat me to filing the bug, but it seems like I’m the only one experiencing the ‘Facebook SDK error 5’ error so I might file another bug as well. I’ll see if I can strip my code and replicate it. I’ll keep you guys updated on this.
Bug was filed: Case 34982
Hi Rob,
I know you guys are crazy busy with iOS8, etc but I noticed in the latest daily build (2014.2458) there were some updates to the facebook plugin.
Just wondered if 34934 (permission switching) was looked at as part of the work being done?
Cheers
What is the page where we can lookup case numbers for bugs? I saw in the release notes that 35950 was fixed but I cant find out what that was
The bug # in the database for 34934 isn’t about facebook.
But as far as I know, it was just an upgrade to the new version. The bug 35950 is about an iOS 8 crash in the background. If your bug is something Facebook might have fixed, then it might be, but it’s not something engineering directly addressed.
Rob
Sorry rob, thats my fault when I copied the number…
Its 34943
The bug is still opening waiting on engineering time.
Rob
Hi Rob,
Do you know if that bug has been looked at? Is there a way we are able to check the progress?
Thanks
Its assigned to an engineer and is in the queue to work on but no more updates.
Rob
After days of struggling i finally have facebook double login and posting to wall working (android).
Putting here so if it helps .
1- Click facebook icon
function postmymsg(event) -- local fbAppID = "XXXXXXXXXX" --replace with your Facebook App ID -- facebook.login( appId, facebookListener, { "user\_friends", "email" } ) fbCommand = POST\_PHOTO facebook.login(appId, callFacebook, {"email", "user\_friends", "publish\_actions"}) end
Note that above I had to also put publish_actions in order to post to wall! (I have email and publish_actions on facebook developer)
2- callFacebook handler
local function callFacebook(event) if ("session" == event.type) then if event.phase ~= "login" then print("not logged in to facebook") return end facebook.login(appid, callFacebook, {"publish\_actions"}) -- This is second login, asks to post to wall if fbCommand == POST\_ABOUT and \_G.fbType == "about" then local postMsg postMsg = { message = " message to send...", name = " name etc.", caption = "stuff", link = "appstorelink", picture = "pictopost" } facebook.request("me/feed", "POST", postMsg) -- sends to wall end end -- callfacebook
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.
Hi Rob,
I noticed the other day that the double login still happens for android. Will this be made to work as the iOS one now works?
Also, any word on the bug 34943?
Cheers
D