Permissions are required to perform a task. Suppose, we own a house having a number of rooms.No one will able to enter until they have key (Here key act as permission).
And we can provide key of some rooms to other , so that they can do specific function in behalf of owner.
So, for performing any task in behalf of owner , permission is required.

Now, coming to Facebook API.
In iPhone , we give permissions to iPhone application so that it can perform functions on behalf of user.

Let take Facebook iOS Sdk, downloaded through link : https://github.com/facebook/facebook-ios-sdk and problem be “To retrieve all Facebook Name and their status”.

For that I have used FQL(Facebook Query Language) . FQL is implemented for complex problems.

In this we can can use query language accordingly to the problem definition.In this case , the query will be made as:

Select name, status from user where uid in (select uid2 from friend where uid1 = <SessionUserId>)

After setting up session and logging in ,a request is made using Facebook iOS sdk as: