Android and Facebook

So, it appears if you want to post on a users wall,  you need to do two separate authorizations.

My setup:

Android

Facebook settings, keys, etc. are all setup correctly.

Facebook app is installed on device.

What I am seeing:

Upon first login attempt, if I do what the instructions say (ie: use “publish_stream” or “publish_actions” permissions), Facebook complains that the “user_info” permission hasn’t been requested first.

So, I redo my workflow and add in the “user_info” permissions along with “publish_actions”.  Facebook then complains that “publish_actions” cannot be requested before requesting “user_info”.

So, I redo my workflow again and just do a first login with “user_info” as the only permission.  Success!  Now, later in the same session I try to do a post and use the “publish_actions” permission (facebook.login() was used for this and the post done in the listener).  Facebook complains that “publish_actions” hasn’t been authorized by the user.  Exiting the app and going back in I use facebook.login with the “publish_actions” permission and it successfully goes through the authorization process and posts for me.

So, I redo my workflow yet again doing a logout after the “user_info” authorization has completed.  I then do the login with “publish_actions” when I am posting and things seem to work out.

I would recommend modifying the tutorial to better reflect how Facebook is presently acting, especially around the order of permissions requests.

Yikes, that does not sound good.  When you post on a user’s wall, what are you posting?  Are you posting on your user’s friend’s wall or user’s own wall?  

I don’t post photos, but I do post scores on user’s wall, and retrieve friends’ scores, and I also post message on friend’s wall using dialog.  With my app, on both iOS and Android versions, once I log in, I don’t need to log out and log back in to do any of these.  (I just checked to make sure nothing broke.)

I’m using daily build 1164, but it’s been working fine for quite a while now for me…

Naomi

All I am doing right now is posting on the users wall.  Once I get to the “publish_actions” permission being accepted, I don’t need to do the logout thing.  I just need to do the logout after the initial authorization.  It’s a pain and highly misleading/ambiguous in the Corona docs.  Of course, it is also highly ambiguous in the Facebook docs as well and I didn’t experience this issue on an iPhone with no Facebook app installed.

Oh, and I’m running the most recent daily build.

Hmmm… strange.  What user_info permission are you using?  I checked FB dev page, and I don’t see “user_info” as an option for permissions, so I’m guessing you’re requesting some other permissions that relate to user info?

BTW, I don’t know if this makes any difference, but the way mine is coded, I mirror the order in which permission is set up on my FB dev page.  So… if I have “permission_1”, “permission_2”, “permission_3” in FB dev page, I call login like this: facebook.login( myAppID, loginListener, {  “permission_1”, “permission_2”, “permission_3”  } ).  This may have nothing to do with the problem you are having, but I thought I’d mention just in case…

Naomi

Hey, @greenrift, I’m now wondering if your problem has anything to do with a bug reported by Andrew @aukStudios:

http://forums.coronalabs.com/topic/37400-facebook-login-flow-on-android-broken-since-daily-build-1141/

I haven’t seen the issue yet with my app, perhaps because I haven’t taken the exact steps to reproduce the problem. 

Naomi

Yikes, that does not sound good.  When you post on a user’s wall, what are you posting?  Are you posting on your user’s friend’s wall or user’s own wall?  

I don’t post photos, but I do post scores on user’s wall, and retrieve friends’ scores, and I also post message on friend’s wall using dialog.  With my app, on both iOS and Android versions, once I log in, I don’t need to log out and log back in to do any of these.  (I just checked to make sure nothing broke.)

I’m using daily build 1164, but it’s been working fine for quite a while now for me…

Naomi

All I am doing right now is posting on the users wall.  Once I get to the “publish_actions” permission being accepted, I don’t need to do the logout thing.  I just need to do the logout after the initial authorization.  It’s a pain and highly misleading/ambiguous in the Corona docs.  Of course, it is also highly ambiguous in the Facebook docs as well and I didn’t experience this issue on an iPhone with no Facebook app installed.

Oh, and I’m running the most recent daily build.

Hmmm… strange.  What user_info permission are you using?  I checked FB dev page, and I don’t see “user_info” as an option for permissions, so I’m guessing you’re requesting some other permissions that relate to user info?

BTW, I don’t know if this makes any difference, but the way mine is coded, I mirror the order in which permission is set up on my FB dev page.  So… if I have “permission_1”, “permission_2”, “permission_3” in FB dev page, I call login like this: facebook.login( myAppID, loginListener, {  “permission_1”, “permission_2”, “permission_3”  } ).  This may have nothing to do with the problem you are having, but I thought I’d mention just in case…

Naomi

Hey, @greenrift, I’m now wondering if your problem has anything to do with a bug reported by Andrew @aukStudios:

http://forums.coronalabs.com/topic/37400-facebook-login-flow-on-android-broken-since-daily-build-1141/

I haven’t seen the issue yet with my app, perhaps because I haven’t taken the exact steps to reproduce the problem. 

Naomi