The first to use facebook API we need to create an app in facebook. Address here: developers.facebook.com/apps
Some points need to correct:
1. Basic setting in your app.
2. Approved items we need.
3. To add user_photos permission in your app.
4. Publish your app.
If you have other questions, just reply on this topic.