× Joomla Facebook Connect support forum

Topic-icon Facebook app integration

Active Subscriptions:

None
14 years 2 months ago #21250 by fb_100000532508192
I am using my website as both standard website and fb app. I would like the jfbconnect to auto login some body that has alreadly given permision to my app.

Just to explain in more detail. fb points to a predefined url. my app asks for relevant permissions(as it would not make sense to ask somebody to login who is already logged in to fb). once the permissions are given i then get jfbconnect to sync data and deal with logged in state etc...

This approach would save me reinventing the wheel...
The topic has been locked.
Support Specialist
14 years 2 months ago #21262 by alzander
Replied by alzander on topic Facebook app integration
Phil,
JFBConnect already has an "Automatically Login Facebook Users" option, which should do just about what you're asking. If they've already approved your app, it will log them in automatically. If they haven't approved it, then they'd need to click the "Login With Facebook" button to approve.

There is a small bug with JFBConnect and that setting now where sometimes the user won't be logged in on the first page they visit, but will be on the 2nd page they load. That will be fixed in the upcoming v4.2 release later this month.

Let me know if that answers your question, or if you were looking for something else.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 1 month ago #21332 by fb_100000532508192
Hi Phil,

Brilliant. That is what i needed. As you stated the update 4.2 will make it smoother also.

Another point, current when logging in via website i have full joomla registration so the user can create thier own username rather than fname.lname or fb_etc..etc..

to keep things smooth i would not want this when registering with fb app. How can i manually override settings so for website (full registration) and for fb(fb only registration).

many thanks in advance
The topic has been locked.
Support Specialist
14 years 1 month ago #21399 by alzander
Replied by alzander on topic Facebook app integration
Phil,
Sorry for the delayed response.

Just to clarify, you want the auto-registration process to happen when they click the Login With Facebook button (first time registration) when they're inside your Facebook Page or Canvas... but if they aren't inside Facebook, you want them to go through the account creation process?

I think that should be pretty easy to do.. but will obviously take a minor code modification. Let me know that I stated it right, and I'll see what I can do.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 1 month ago #21415 by fb_100000532508192
Hi Alex,

That is exactly what i would require. Show me the way.

thanks,

phil
The topic has been locked.
Support Specialist
14 years 1 month ago #21499 by alzander
Replied by alzander on topic Facebook app integration
Phil,
Very, very sorry for the long delay. I was out of town this weekend, and this issue simply slipped before I left. Hopefully, the below will get you going right away, but if you run into issues, let me know.. I'll be quicker going forward :)

JFBConnect has a pretty easy way to detect if you're in a Facebook Canvas view. Using that, we should be able to do what you're looking for. To implement it, edit the /components/com_jfbconnect/controller.php file. Around line 71, you'll see:
if ($configModel->getSetting('create_new_users') && $jUserId == null)
Change it to the following:
$jSession =& JFactory::getSession();
            $inCanvas = $jSession->get('jfbcCanvasEnabled', false);
            if (($configModel->getSetting('create_new_users') && !$inCanvas) && $jUserId == null)

Then, just make sure the "User Creation" setting is set to "Full Joomla User". When the user is in the canvas, their account should be created automatically. When not, they should go through the full reg process.

The code above hasn't been tested, but it's pretty straightforward. Please test (a lot), and let us know how it goes!

Thanks,
Alex
Edit: Minor change to the code above to make sure you aren't in the Canvas for the full form to be displayed
The topic has been locked.
Active Subscriptions:

None
14 years 1 month ago #21512 by fb_100000532508192
Hi Alex,

Thank you for the code. i have tested in many situations but the results are the same. joomla still wants full registration.

After looking at the user experience in more depth. when a user installs an app in fb e.g. angry bird. a dialog box appears asking for relavant permissions before the app is shown. This in thoery is the same as the jfb login dialog. the only difference is that the first is within the app and jfb's is in effect a popup window.

Is it possible to either create the permissions dialog and then check/sync using jfb.

or can jfb create the dialog within the app window and then create user and sync etc...

i'm trying to keep things as simple as posible. Do you have any plans for developer addons or api's?

many thanks
The topic has been locked.
Support Specialist
14 years 1 month ago #21532 by alzander
Replied by alzander on topic Facebook app integration
Phil,
Ahhh. What you're looking for is Authenticated Referrals. You can enable Authenticated Referrals in your Facebook Application in the "Auth" section. This will make it so that if anyone uses a link from within Facebook to go to your Page, they will have to authenticate before 'seeing' the Page. If a user goes directly to your Facebook Page Tab, the authentication popup will -not- appear (just so you know).

We've helped a few users get the Authenticated Referrals working already so that it will automatically create the account. We haven't helped with the hybrid mode that you're trying for yet, though. With JFBConnect v4.1.x (the current release), it can take a little bit of effort. With the 4.2 release, it won't be official, but we're trying to have pretty 'out-of-the-box' support for Authenticated Referrals. We'll be testing it after 4.2 comes out and promoting that feature in a later release. If you're interested in a quick change that may work for you now though, see the thread below:
www.sourcecoast.com/forums/jfbconnect/jf...ng-joomla?p=1#p20805

Try to get that working, by itself, before you go for the hybrid full registration in some places vs auto in others.. once that's going, then we can try to add on more stuff. Sound good?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 1 month ago #21898 by fb_100000532508192
Hi Alex,

Thank you for your response. i had a few issue after upgrading so was playing around. Following on from what you have posted above i have almost achieved the diesired results.

i have implemented the require changes within fb itself so now the auth dialog box apprears when trying to use the app in fb directly. After this the app still
a: shows the login with facebook within the iframe.
b: when this is clicked, the login pops up briefly then disapears. then a screen refresh which shows the login button again.

Any addition help. i feel we are almost there.

Phil
The topic has been locked.
Active Subscriptions:

None
14 years 1 month ago #21901 by fb_100000532508192
Quick update.

if i set registration to automatic. then the login button still shows(not what i want) but if i click on this then everything logs in correctly etc.

Just need jfb to know when it is in fb iframe and then register user. But still need full user registration for front of site.

Has anybody succeeded with this.
The topic has been locked.