Home
Username:
Password:
Facebook Application Development Tutorials

Using More Integration Points / Adding to the Profile App Info/Code




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

Now let's look at how you as the Developer support the Info box. There are two things you have to do. You have to put the button on a page, usually your Index page, the Home page and then you have to feed information to it. Now putting that button on there is really very simple because you've got a piece of FBML here and this is what you use and as long as you have the section-button here, Facebook will take care of adding that section-button if, indeed, you need it; that is, if the user has not already done it and if the user then removes it it'll be back. It's just this one line of code in index.php and you put it where you want it. I've put it ahead of the tabs. That's all you do. Now we need a little more code in my picks. Now remember that my picks has this code that is called when the doNews parameter is passed in. We get all these other parameters that are passed in and then we have doNews, which does the News Feed. And you've seen a section of code here before which publishes the user action, that's fine. We construct the tokens Array and so forth and this is the code that you've seen to publish the user action. This is the code down here that you need to update the Info box and it's fairly straightforward. You need this associative Array. It has two named items in it. The field and the items. The field is the text that's going to appear on the Profile - I use Latest Pick, you could use any text that you want - it is usually hard coded. And then the items part of the Array is itself an Array which has a label, a description and a link and it's very simple. Facebook is going to be formatting this for you. It's very simple. The label is the name of the pick in this case, the description is whatever description that you want. I use the fullAddress that I already created for the News Feed and the link. You put a link onto it and I can just construct it right down here. This is the link to my App and this is the link that will go back to this particular pick on the App. Obviously your link is going to differ and whether you go to the App in general or to a specific item on the App it's up to you. But the more specific you can be, the more the link actually goes to your App and to the piece of information about which you have shown Info in the Info box, the better the experience will be for the user. So this is all that I need to do and then I call profile setProfile and the 5 determines the type of text that I'm passing in in these parameters in the info fields Array. So that's all that I do down here. I've done one additional thing and I've used the begin batch and the end batch api client calls and what they do is, if you're familiar with databases and transactions, that's basically what's happening here. I'm saying that this code is going to be sent to Facebook and when end batch happens the whole thing will be executed as if it were one thing, so except for very slight possibilities, really very hard to find, you will update the user feed and the info box in the Profile at the same time and this can make your App more responsive and more efficient. And basically that's how you use this variety of integration points: the News Feed, the Info Box, the Tab and the more you use these the more the experience on Facebook will be richer for your users.

Tutorial Information

Course: Facebook Application Development
Author: Jesse Feiler
SKU: 34058
ISBN: 1-935320-81-5
Release Date: 2009-11-23
Duration: 7.5 hrs / 92 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available