Facebook permissions are acting up on Android.

Ok, so our iPhone 5 info (problematic, not working):

iOS - 6.1.3 (10B329).

Model - MD298B/A.

iPhone 4S (works just fine):

iOS - 6.1.3 (10B329).

Model - MD235IP/A.

Hope this helps, and this bug is really terrible, getting zero response from the API is a killer to any app needing the use of that social virus called Facebook :slight_smile:

Hello again Naomi, or anyone reading this post who might have the answer:

Lets assume I’ve change my Facebook handling flow, and to minimize the requests permissions API windows I don’t ask any permissions when I do the first log in (taking our the email and publish requests out of the log in), so how do I get those permission when I do need to publish something? do I need to re logged in with the requests I need, or is there some other way to ask for specific permissions one I’ve already logged in?

Thanks.

When you need more Facebook permissions then you will call facebook.login() again with the new permissions that you want.  If the user has previously logged and has not granted the the permissions yet then it will ask for the new permissions.  If the user has previously granted those permissions then it will just called the listener and you can continue on.

@formatc, about not getting any response from the API with iPhone5 you mentioned above, have you had a chance to file a bug report?  If it’s still a problem, it would be great if you could submit a report and have it looked at.  (I have not had a chance to test this myself and not sure if I will be able to anytime soon.)

Naomi

dchan, thanks for the info, I’ve already figured that solution out by testing, it works wonders and changes the flow of my Facebook interactions completely, and in a good way, so thank again!

Naomi, I did file a bug report, with an example project and everything, I’m sure it’s being looked at, I’ll update this thread as soon as I have some response about this issue :slight_smile:

Yuval.

Hi Yuval,

Which build of Corona are you using?  Also, what version of Android are you running on your device, and is the Facebook app installed on the device?

  • Andrew

I’m using build number 2013.1232 (2013.10.9), I’m running android 4.1.2 on a Galaxy SIII, facebook app is not installed on my device, and never will be should I have a choice in the matter :slight_smile:

Thanks!

I’ve upgraded to build 2013.1257 (tried to the last build, the legacy one, but it had some problems, like asking for a password for the debug.keystone, which don’t have one, so that’s gone), and it still shows the same problem, on first Facebook log in, it asks me 3 times to authorize the app after log in, then it goes on normally.

Yuval.

Hi Yuval,

Can you post your code showing where you are calling facebook.login()?  Also, what permissions are you requesting from the user?  When you say that, on Android, it prompts the user 3 times for permission, is it asking for the same permission each time, or a different permission?

  • Andrew

I’m sorry if I was misunderstood, what happens is that the “popup” from the Facebook api, after I log in for the first time, asks me to authorize the app to use my Facebook account, or in my case, in tells me that the app is already authorized (since I’ve logged before), and I can choose “OK”, or “skip”, if I choose "OK, or “skip”, it does not matter, it popup the same api window telling my I have already authorized my app 3 times until it closes and goes away.

Yuval.

I even tried a mix of “OK”'s and "skip"s, but it’s the same, 3 “requests” of authorization telling me I’ve already authorized the app.

OK, I follow you.  Can you post the portion of your code where you call facebook.login()?  What permissions are you requesting?

  • Andrew

Yep, the code is:

if login\_data.type == 1 then       facebook.login(appId, facebook\_listener, {"publish\_stream", "email"}); elseif login\_data.type == 2 then       facebook.request("me/friends", "GET", {fields = "id,name,picture"}); end

Explanation:

If the user have not done a Facebook log in before, I do a log in, and in the response of the log in I would get the list I’m requesting here in the case the user have already done a Facebook log in, simple enough.

Right now I’m also trying to output to a debugger any response from the Facebook API so I would know if it’s not me making 3 calls, but the API acting up (my best clue so far is that it does not do this on the iOS version…).

And, as you can see, the permissions I’m asking for are “publish_stream” so I could post to friends wall, and “email”, so I could use it if the user chooses to do first log in to our app with his Facebook account instead of registering a “simple” account with our app.

Hope this helps, and I’ll get back to you with the results of my tests now to see I’m not over calling the API by some weird mistake that got in since the last version I compiled, which I don’t happens.

Yuval.

Ok, I’ve done 2 tests:

  1. checked the number of calls I make to the API when I need the information, after I authorized my app, and it’s 1 call, not 3.

  2. Removed the authorization to my app in my Facebook account, then did the re log, and request for friends list, this time, 2 calls, one for log in, one for list.

Result:

In both cases I was prompted for Authorizing my app 3 times before it went on.

Please note this happens only on the first time I use the Facebook API in my app, meaning the next time I’ll go into the part of the app that needs the list from Facebook, it will get it without prompt at all. Only if I uninstall the app, re install, and re request the information it will ask me 3 times to authorize the app.

Yuval.

Can you try deauthorizing your app from your Facebook account, then logging into it again?  I suspect that the 3 logins are related to the three permissions you’re requesting (basic_info, publish_stream, and email).  If the app isn’t authorized, I suspect the popups will ask for those three permissions one at a time.  If the app is already authorized, then the three popups are indicating that each permission is already authorized.

  • Andrew

Hey Andrew, a message above your, which you probably missed while writing your message, explains I’ve done just that, deauthorize the app, re logging, and exactly that happens, I make 2 call in total, 1 for the log in, once that is approved, 1 for the list of friend, yet still I’m being asked to authorize the app 3 times.

What I can do is remove the request for email, since I use that information only if I choose to register through Facebook, and see if I get only 2 times to Authorize instead of the 3.

Another problem I’ve just noticed, again, with Facebook, this time on iOS, is that if the Facebook app (may it burn in hell) is installed on the device, on the iPhone 4s, I have no problems with getting information from Facebook, while on the iPhone 5, the log in goes fine, but the request for information does not work, when I delete the Facebook app from the iPhone 5, it works just fine.

I’m still testing this problem to see what I do get, I’ll keep you updated.

Yuval.

OK, so the mail removal test was good, this time it asked me for the authorization only twice, not 3 times, so I guess your theory is correct, but why would it do that? and is there a way around it?

Yuval.

This is so frustrating!!

So on iPhone 4/4S with or without Facebook app installed, everything works fine, on iPhone 5, without Facebook app, works fine, with the Facebook app the Facebook API log in request pops up the APIs window, which closes by itself, since the device is already logged in, but the event listener does not fire at all!!

I hate face book so much… over so many years, working with anything related to Facebook was always a thorn in my ass, pardon my language… Anyone has any insight on this issue?

By the way, if I don’t have the Facebook app on the iPhone 5, I log in with my app to Facebook, it works ok, I ask for friends list, works ok, install the Facebook app, relaunch my app, ask for friends list again, works just fine, re install my app at this point, re log to Facebook, and nothing, listener is dead as a week old mouse in a trap.

Let me try to simplify the scenario to make sure I understand.  Launch the app for the first time and log in with facebook using facebook.login().  The facebook listener will fire.  Force quite the app and relaunch it.  If you call facebook.login() again, are you saying that the listener does not fire this time (on certain devices, namely your iPhone 5 when the Facebook app is installed)?

I haven’t experienced any issue like that.

  • Andrew

Nope, here it is broken down.

Case 1:

  1. Our suspect, an iPhone 5, clean, no FB app.

  2. Install my app, log in to it, do FB.login(), works.

  3. Ask friends list, works.

  4. Install FB app.

  5. Log out then in into my app, or remove and re install my app.

  6. Do FB.login(), works.

  7. Ask friends list, works.

JOY!

Case 2:

  1. Our suspect, an iPhone 5, with FB app.

  2. Install my app, log in to it, do FB.login(), DON’T WORK :frowning:

It would seems that if at some point you’ve logged into Facebook with my app before you had the FB app on it, there would be no problem to re log or request anything from the FB API, but once the FB is installed BEFORE you’ve logged in at least once with our app to Facebook, the listener we set up for Facebook event simply keeps quite.

And yes, it means if I have the phone with both the apps, both working, and I remove both of them, but then install FB App and log, then my app then log, and try FB.login() from my app, there is no response from the listener function, even though you can clearly see the FB API window popping up then off the screen.