Custom Search

Showing posts with label Facebook connect for iPhone. Show all posts
Showing posts with label Facebook connect for iPhone. Show all posts

Saturday, December 26, 2009

Facebook multiquery

Evaluates a series of FQL (Facebook Query Language) queries in one call and returns the data at one time.

This method takes a JSON-encoded dictionary called queries where the individual queries use the exact same syntax as a query made with fql.query. However, this method allows for more complex queries to be made. You can fetch data from one query and use it in another query within the same call. The WHERE clause is optional in the latter query, since it references data that’s already been fetched. To reference the results of one query in another query within the same call, specify its name in the FROM clause, preceded by #.

For example, say you want to get some data about a user attending an event. Normally, you’d have to perform two queries in a row, waiting for the results of the first query before running the second query, since the second query depends on data from the first one. But with fql.multiquery, you can run them at the same time, and get all the results you need, giving you better performance than running a series of fql.query calls. First, you need to get the user ID and RSVP status of each attendee, so you’d formulate the first query – query1 – like this:

"query1":"SELECT uid, rsvp_status FROM event_member WHERE eid=12345678"

Then to get each attendee’s profile data (name, URL, and picture in this instance), you’d make a second query – query2 – which references the results from query1. You formulate query2 like this:

"query2":"SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #query1)"

This method also has better performance than running a series of fql.query calls with batch.run.


For more information about fql.multiquery see this link where these texts are taken from.

Friday, December 25, 2009

Multiple action links problem in Facebook

We're focused on creating the best ways to empower users to share with their friends, as well as providing developers with the tools they need to make applications social and add value to the Facebook experience. As a part of a greater effort to simplify the site, Facebook developers made it easier for users to discover the most interesting content by modifying the home page stream to include two views:

§ News Feed focus on popular content, determined by an algorithm based on interest in that story, including the number of times an item is liked or commented on.

§ Live Feed display all recent stories from a large number of a user's friends.

Stories your applications generate can show up in both views. The best way for your stories to appear in the News Feed filter is to create stories that are highly engaging, as high quality, interesting stories are most likely to garner likes and comments by the user's friends.

In addition to making the site cleaner and simpler for users, they are also making our APIs clearer and more straightforward for developers. They built many APIs to enable you to create rich social experiences for your users, and while they create these APIs to match pace with the evolution of the features offered, we often maintain similar, more primitive versions as well. This creates a sea of different methods with overlapping functionality. To make it simpler and easier to develop on Facebook, they are streamlining our APIs, beginning with those that publish older-style, template-based Feed stories.

Going forward, the only way to publish Feed stories into the stream is via the stream publishing methods (stream.publish, FB.Connect.streamPublish, and Facebook.streamPublish). Posts published using the stream publishing methods contain only structured plain text data, which makes them easier to render on a variety of devices, including mobile phones and gaming consoles. For everyone else, these changes took place on December 20th, 2009.

This means that they discontinued support for the following:

· Template bundles. You should start using stream attachments with the stream publishing methods instead.

· feed.publishUserAction

· feed.publishTemplatizedAction

· Facebook.showFeedDialog and FB.Connect.showFeedDialog

· Publisher stories that use templates (please transition them to use stream attachments).

· Feed forms that reference the feedStory form and the multiFeedStory form.

· One-line stream stories.

They still publish stories that call users.setStatus and status.set, but encourage all developers to migrate to the stream publishing methods, as they let you set a user's status easily.

They have already made a few changes to how stream stories are rendered. First, they are shrinking the size of images to be rendered at a maximum of 90 pixels high or 90 pixels wide. Also, stream stories only display the first image that has been passed to them. Most Facebook stories use a single image, and many use no images at all. If the stream story contains more than one image or a significant amount of text, the first image and a couple lines of text display initially, and the user have the option to click a "See More" link to display the rest of the story. They find that the best images in stream stories are directly relevant to the action taken with the application. For example, if the story announces a user's high score in a game, the image should show that exact score. If the story shows content the user has created (for example, photos taken or art created), the image should be that user-generated content. Highly repetitive images that show up over and over aren't nearly as interesting or engaging.

They have made changes to action links to create a cleaner user experience. Going forward, a stream story can have a maximum of one action link and 25 characters in the link. Facebook's own action links tend to be even shorter than that ("Comment", "Like", "Share", "Become a Fan" are all ten characters or fewer). They strip out "formatting" characters (for example, leading spaces, pipes, and brackets) to keep in the same simple aesthetic as the rest of Facebook.

They look forward to making our APIs more straightforward and hope you are too. They welcome your comments in their Developer Forum.

These texts are taken from the blog.

Friday, September 25, 2009

How to get facebook connect permissions

Facebook offers some API functionality that requires the user to specifically opt in before your application or site can use that functionality. These methods are specific to certain use cases that require a greater level of trust from the user. Users express this trust by granting your application or site specific extended permissions. These permissions allow your application to perform certain actions.
The available extended permissions are:

1. publish_stream -- Lets your application or site post content, comments, and likes to a user's profile and in the streams of the user's friends without prompting the user. This permission is a superset of the status_update, photo_upload, video_upload, create_note, and share_item extended permissions, so if you haven't prompted users for those permissions yet, you need only prompt them for publish_stream.

2. read_stream -- Lets your application or site access a user's stream and display it. This includes all of the posts in a user's stream. You need an active session with the user to get this data.

3. email -- This permission allows an application to send email to its user. When the user accepts, you can send him/her an email via notifications.sendEmail.

4. offline_access -- This permission grants an application access to user data when the user is offline or doesn't have an active session.

5. create_event -- This permission allows an app to create and modify events for a user via the events.create, events.edit and events.cancel methods.

6. rsvp_event -- This permission allows an app to RSVP to an event on behalf of a user via the events.rsvp method.

7. sms -- This permission allows a mobile application to send messages to the user and respond to messages from the user via text message.

8. status_update -- This permission grants your application the ability to update a user's or Facebook Page's status with the status.set or users.setStatus method.
Note: You should prompt users for the publish_stream permission instead, since it includes the ability to update a user's status.

9. photo_upload -- This permission relaxes requirements on the photos.upload and photos.addTag methods. If the user grants this permission, photos uploaded by the application will bypass the pending state and the user will not have to manually approve the photos each time.
Note: You should prompt users for the publish_stream permission instead, since it includes the ability to upload a photo.

10. video_upload -- This permission allows an application to provide the mechanism for a user to upload videos to their profile.
Note: You should prompt users for the publish_stream permission instead, since it includes the ability to upload a video.

11. create_note -- This permission allows an application to provide the mechanism for a user to write, edit, and delete notes on their profile.
Note: You should prompt users for the publish_stream permission instead, since it includes the ability to let a user write notes.

12. share_item -- This permission allows an application to provide the mechanism for a user to post links to their profile.
Note: You should prompt users for the publish_stream permission instead, since it includes the ability to let a user share links.



How to do some more important functions using FBConnect API

As you all know Facebook is heavily used social network system. So it has more important functions which should be in social network system. The following functions I have implemented to help those who are interesting on FBConnect API.

1. Get current user's Facebook friend lists
2. Get all visible groups according to the filters specified
3. Get membership list data associated with a group
4. Get all visible photos according to the filters specified
6. Get metadata about all of the photo albums uploaded by the specified user
7. Uploads a photo owned by the current session user
8. Updates a user's Facebook status through your application
9. Publishes a post into the stream on the user's Wall and News Feed (Text + Images)
10. Get user-specific information for each user identifier passed, limited by the view of the current user

To get the iPhone project to learn above functions download application from here. You can see the code and test with other functions as well. How to call their database is more important thing when we use FBConnect API. You can learn it also from this application.