ToDo and Not ToDo when developing facebook application
Below tips for those who develop iframe base facebook application or facebook connect base application.
Tips # 1
Avoid facebook api call as much as possible.
$fbme = $facebook->api('/me');
Save api result that you will frequently use in memcache or php session
session_start(); $fbme = $facebook->api('/me'); $_SESSION['fb_user_data'] = $fbme;
Tips # 2
Check this tutorial to increase the authentication performance of your application
Tips # 3
Write facebook viral feature related codes in once place, better in a class. And call the functions of that class in various place of your project where its needed.
Tips # 4
Tips # 5
Tips # 6
Retrieve user’s facebook friends once and save them in the current session to avoid facebook api call each time.
session_start(); $friends = $facebook->api('/me/friends'); $_SESSION['fb_user_friends'] = $friends;
Tips # 7
Tips # 8
By time facebook limited their viral features. So don’t forget to use facebook’s 3 viral features now:
- Invitation feature
- Wall post publishing feature
- Email send feature
Tips # 9
Keep your eye open to facebook’s real time update. Facebook announce their platform activities here. So you’ll know earlier what changes will appear soon in the facebook platform.
Tips # 10
Checkout facebook official documention for any kind of reference related to their platform.