Facebook double-login

Is the facebook double-login something that is specific for Corona or is it Facebook dictated ?

By double-login I mean, we first need to login without permission and then second time with the required permissions.

Facebook dictated.

Not sure double-login is needed.

I am now reading through the new Facebook API v2.

Seems for basic login you MUST ask for “public_profile” on mobile and that call should be enough.

After login, you can ask for public_profile fields (name, gender, location etc.).

Be aware: “username” is no longer there!

Will try this and let you know how it goes.

Regards,

Damir.

Using daily build 2300.

It works using one login call with “public_profile” permission.

And I am getting the username !?

For basic permissions, i.e. read only basic profile stuff, you only need one login.  If you need extended permissions, like getting someones email, or writing to their timeline you have to make a 2nd request to get those features.

Rob

Facebook dictated.

Not sure double-login is needed.

I am now reading through the new Facebook API v2.

Seems for basic login you MUST ask for “public_profile” on mobile and that call should be enough.

After login, you can ask for public_profile fields (name, gender, location etc.).

Be aware: “username” is no longer there!

Will try this and let you know how it goes.

Regards,

Damir.

Using daily build 2300.

It works using one login call with “public_profile” permission.

And I am getting the username !?

For basic permissions, i.e. read only basic profile stuff, you only need one login.  If you need extended permissions, like getting someones email, or writing to their timeline you have to make a 2nd request to get those features.

Rob

I also found it’s happening and I think my code is not handling it right.

I basically call following to log in when the user clicks “Share”:

facebook.login( fbAppID, facebookListener, { “publish_actions” }) 

and in the callback, if the login succeeds, I call

facebook.request( “me/feed”, “POST”, param )

to post some thing on the wall.

What’s the correct flow to solve this double login requirement? any sample code available?

Do I need to call facebook.login() again inside the callback that indicates the first facebook.login() succeeds?

The correct workflow is to call

facebook.login(fbAppID, facebookListener)

This will request public_profile  and if you need, you can also ask for “email” and “user_friends” at this time, like:

facebook.login(fbAppID, facebookListener, { “public_profile”, “email”, “user_friends” } )

When you get the call back and it’s successful (see the Facebook Sample app), then when you need additional permissions, you ask for them then.  So when you’re ready to post, you then call:

facebook.login(fbAppID, facebookListener, { “publish_stream” })

Now you can change your listener function to a different one, or set a flag for  your main listener to recognize this time you’re doing the second call.  When it succeeds, then you call facebook.request() with your “me/feed” post.

I also found it’s happening and I think my code is not handling it right.

I basically call following to log in when the user clicks “Share”:

facebook.login( fbAppID, facebookListener, { “publish_actions” }) 

and in the callback, if the login succeeds, I call

facebook.request( “me/feed”, “POST”, param )

to post some thing on the wall.

What’s the correct flow to solve this double login requirement? any sample code available?

Do I need to call facebook.login() again inside the callback that indicates the first facebook.login() succeeds?

The correct workflow is to call

facebook.login(fbAppID, facebookListener)

This will request public_profile  and if you need, you can also ask for “email” and “user_friends” at this time, like:

facebook.login(fbAppID, facebookListener, { “public_profile”, “email”, “user_friends” } )

When you get the call back and it’s successful (see the Facebook Sample app), then when you need additional permissions, you ask for them then.  So when you’re ready to post, you then call:

facebook.login(fbAppID, facebookListener, { “publish_stream” })

Now you can change your listener function to a different one, or set a flag for  your main listener to recognize this time you’re doing the second call.  When it succeeds, then you call facebook.request() with your “me/feed” post.