× Joomla Facebook Connect support forum

Topic-icon 3rd Party Extension Integration

Active Subscriptions:

None
I have just created a custom extension for my joomla site which integrates with facebook. I am using JFBConnect to allow users to register to my site with their facebooks account which works great. I need to create a plugin for JFBConnect so it integrates with my custom component.

Looking through the virtuemart profile plugin i can see that the method "jfbcProfilesOnRegister" is run after the user has been created on the joomla site. The problem i am having is that i can't retrieve the data from the facebook user so i can save into my custom component.

Is there any documentation on how to create my own plugin for jfbconnect component or can someone give me a simple example on how to retrieve the data from the facebook user. The only extra fields i need is the home town of the user (user_hometown) and the users birthday (user_birthday). These have been added to the "Additional Permissions Request" in the parameters of the component.

Hope this makes sense.
The topic has been locked.
Support Specialist
14 years 10 months ago #11928 by alzander
Jon,
Sorry for the delay. We've actually been working a little bit on developer documentation, and while it's certainly not perfect yet, I just put up the Profile Plugin page, which you can see below. Hopefully, this will answer your questions.
www.sourcecoast.com/jfbconnect/docs/deve...ing-a-profile-plugin

Basically, for your own component, you should read the constructor information on that page, and you'll want to define the field_mapping setting. This is just an array of your fields to Facebook fields:
$map = array(17 => 'hometown_location.city', 'your_field' => 'hometown_location.state');
Where 17 or your_field are however you want to name your fields. You'll use these values in the addFieldToDb calls later on.

Once defined there, JFBConnect will take care of requesting the permissions from the user. In the onRegister or onLogin functions, simply call the parent::importProfile() function, which will then call the addFieldToDb call for each field.

Hope this all makes sense, but please let us know if there's anything we can clarify. The profile plugin API isn't perfect, but it should hopefully make your life easier. There is a plan to revamp our calls and make it much simpler in the future. For now though, you should be able to implement your stuff pretty easily (we hope).

Good luck,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 10 months ago #11982 by fb_100001852085900
Thanks for your help alzander, I have now managed to integrate this with my custom component.
The topic has been locked.
Support Specialist
14 years 10 months ago #11997 by alzander
Fantasitc! Glad to hear you got it going, and hope our documentation helped. The profile plugin code is going to be changing over the next few releases (not too much for 4.0 though). This will make development a little easier, but mainly wanted to call it out so that when you upgrade, you know to check that guide and/or test to make sure things don't break.

Finally, please consider leaving a rating and review on the Joomla Extension Directory for JFBConnect and our support. It's certainly not required, but very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.