开发者

Facebook Javascript vs PHP SDK

开发者 https://www.devze.com 2023-02-18 06:50 出处:网络
I am somewhat confused by the facebook developers guide. Some tutorials show the javascript SDK being used while some show the PHP SDK being used. Do I need to load both of these? Are there any differ

I am somewhat confused by the facebook developers guide. Some tutorials show the javascript SDK being used while some show the PHP SDK being used. Do I need to load both of these? Are there any differences between the two (besides one being client and one being server)?

I am wanting to use Facebook's SDK for User Authentication, Social Plug开发者_如何学运维ins, and the Graph API.


The best advice I can give you - be very careful when planning a new development on the Facebook Platform. A lot of the documentation is seriously out of date, and this is exacerbated by sporadic platform revisions.

Admittedly, this has improved in recent months, but I digress...

Facebook have recently deprecated the creation of FBML canvas applications, which means your application will have to be in an iframe. This also implies you could make the applications available off of Facebook too (e.g., http://apps.facebook.com/someapp/ and http://www.someapp.com/ can both load up). This narrows the benefits of using the PHP SDK, as a lot of the functionality is available via the JavaScript API.


For SDK authentication you should use the Javascript SDK. It's much easier to set up things properly.

For the Graph API, it depends what kind of application you are going to build. If you are storing or processing stuff on the server side then you will have to use the PHP SDK.

You don't need to use an SDK for their Social plugins. You just have to copy-paste sample code in most cases.


Many tasks/calls can be done by javascript. I use both for my. 85% JavaScript and 15% PHP. Reason: If you have an App with > 10000 dau's, the PHP SDK will suck sometimes, because every api-call needs at least 0.3s via cURL on my machine.

My Opinion: Use PHP SDK only if necessary

0

精彩评论

暂无评论...
验证码 换一张
取 消