Facebook Application Development PHP SDK 3.1.1


Hits: 3578  

Facebook is going to upgrade Developer API by 1st October 2011. All sites and apps on Facebook will migrate to OAuth 2.0 through this update. This will ensure that users browsing Facebook over HTTPS will have a great experience over a secure connection. We can imagine that these changes will make facebook better and more secure while browsing apps.

Reminder- Upgrade Your App to OAuth 2.0 and HTTPS by October 1st

Today I get this notification from facebook 🙁
We can upgrade existing FB Apps created using old version of SDK see here

Code sample for FB Login Button / Link
Upgrade Your App to OAuth 2.0 and HTTPS

Code sample for FB publish & get user information
Upgrade Your App to OAuth 2.0 and HTTPS

Review Demo App using PHP SDK 3.1.1
Upgrade Your App to OAuth 2.0 and HTTPS

Login to App
Upgrade Your App to OAuth 2.0 and HTTPS

Advanced permission for App with PHP SDK 3.1.1

Upgrade Your App to OAuth 2.0 and HTTPS

Updates posted on wall using PHP SDK 3.1.1

Upgrade Your App to OAuth 2.0 and HTTPS

Get more help here: FBTerminal or discuss here skype: svnlabs 🙂

Upgrade Your App to OAuth 2.0 and HTTPS by October 1st


Hits: 4619  

Reminder- Upgrade Your App to OAuth 2.0 and HTTPS by October 1st

Facebook is going to upgrade Developer API by 1st October 2011. All sites and apps on Facebook will migrate to OAuth 2.0 through this update. This will ensure that users browsing Facebook over HTTPS will have a great experience over a secure connection. We can imagine that these changes will make facebook better and more secure while browsing apps.

Upgrading by 1st October

All websites and canvas apps must support OAuth 2.0.
All Canvas and Page Tab Apps must use the signed_request parameter.
SSL Certificate is required for all Canvas and Page Tab apps.
Users can not use Sandbox mode and not FBML.
Previous versions of our SDKs will stop working.

How to migrate to OAuth 2.0

Implementing the OAuth 2.0 authentication system.
Use latest SDKs – PHP SDK v.3.1.1.
Enable the Encrypted Access Token migration in the Developer App to use the encrypted access token.
Canvas Apps must verify that your app is using the signed_request parameter.

Reminder: Upgrade Your App to OAuth 2.0 and HTTPS by October 1st. In May we announced that all apps on Facebook need to support OAuth 2.0 and HTTPS to make the platform more secure.

All apps, including page tab apps, must migrate to OAuth 2.0 for authentication. The old SDKs, including the old JavaScript SDK (FeatureLoader.js) and old iOS SDK (facebook-iphone-sdk) will no longer work. In addition, non-iframe Canvas and Page Tab apps must support HTTPS and provide a secure canvas or secure page tab URL.

If you haven’t already made these changes, visit the Developer Roadmap before October 1st for more information about how to upgrade your app and avoid having it disabled.
You can also seek support in the Facebook Developer Group: https://www.facebook.com/groups/fbdevelopers/

Get more help here: FBTerminal or discuss here skype: svnlabs 🙂

FBTerminal – Tool to access facebook on command lines


Hits: 4849  

FBTerminal is a command line interface (CLI) for facebook designed in PHP using Facebook Application ID, Secret and Access Token.

It will work on Windows (CMD.exe), Linux/MAC (Terminal).

Right now FBTerminal have limited commands like status update, text post, photo upload etc. FBTerminal will be updated for all basic commands on facebook.

You must have compatible PHP version with setting on server to access FBTerminal.

# php -r “echo phpversion();”
# php -r “echo ini_get(‘allow_url_fopen’);”

Code sample how FBTerminal trace command line

Code sample to upload photos

Photos are in folder

Linux Version

Output

Windows Version

Output

Application
FBTerminal can be used in various application that need seamless integration of facebook from backends.
FBTerminal is useful in viral marketing on facebook.
FBTerminal can be used for backup facebook data to server’s file system.

Exceptions with Facebook Apps


Hits: 4343  

OAuthException: Error validating access token: Session has expired at unix time 1311357600. The current unix time is 1311357734

Request FB Access Token each & every time…

Rotate Apps…


OAuthException: (#1) An unknown error occurred

Sometime facebook block App’s domain and text, images, links etc. used on apps, You can use URL Linter to cross check

https://developers.facebook.com/tools/lint?url=svnlabs.com

http://forum.developers.facebook.net/viewtopic.php?id=78958 🙁

Provide UTF8 Content…


OAuthException: (#210) User not visible

The actual error is “Your friend do not allow posts on his wall”


OAuthException [message] => (#341) Feed action request limit reached


OAuthException: (#100) The post’s links must directly to the application’s connect or canvas URL

This can be solved by going into application settings -> advanced -> and setting the Stream post URL security to disabled.


Use JavaScript API to get user’s real country / location…


Add valid conditions before publishing…


I learned from Facebook…

1. Build stuff that will get used. Fast.
2. Engineering Innovation
3. Small Team, Big Impact
4. Connecting the World
5. Prime Time Hack


RoadMap
*******
Keep yourself updated with all latest changes on FB API 😉

http://developers.facebook.com/roadmap/

fbsocialmarketing.com


Hits: 1957  

FB Social Marketing is a Social Media Marketing company specializing in the development of Facebook Fan Pages for your business.

Be sure to check out complete line of training videos.

I have partnered with Shelle Kind of fbsocialmarketing.com and we have released the Amazon S3 / EC2 Solution for Facebook fanpage apps.

Save Facebook Profile Photo


Hits: 3020  
<?php

$facebook_uid = '100000296428149';
$sourcecode = save_facebook_profile_photo($facebook_uid);

print_r($sourcecode);

file_put_contents("images/".$facebook_uid.".jpg", file_get_contents($sourcecode['url'])); //this is name of new file that i save

function save_facebook_profile_photo( $id )
{
    $options = array(
        CURLOPT_RETURNTRANSFER => true,     // return web page
        CURLOPT_HEADER         => false,    // don't return headers
        CURLOPT_FOLLOWLOCATION => true,     // follow redirects
        CURLOPT_ENCODING       => "",       // handle all encodings
        CURLOPT_USERAGENT      => "spider", // who am i
        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
        CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
        CURLOPT_TIMEOUT        => 120,      // timeout on response
        CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
    );
    
    $url = "http://graph.facebook.com/".$id."/picture";

    $ch      = curl_init( $url );
    curl_setopt_array( $ch, $options );
    $content = curl_exec( $ch );
    $err     = curl_errno( $ch );
    $errmsg  = curl_error( $ch );
    $header  = curl_getinfo( $ch );
    curl_close( $ch );

    //$header['errno']   = $err;
    //$header['errmsg']  = $errmsg;
    //$header['content'] = $content;
    print($header[0]);
    return $header;
}  

?>

Facebook Search Users with Email and Save to Database


Hits: 2312  

Search Facebook Users in Facebook website and save to any external database (text, csv, json, xml etc.)……

Image Map in FBML


Hits: 2335  

Facebook FBML application does not support hotspots in an image map using dreamweaver.

<div style="position: relative;">
<!-- Hot Spots - Image Map -->
<div id="svnlabs1" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 72px; left: 460px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs2" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 11px; left: 635px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs3" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 170px; left: 632px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs4" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 78px; left: 887px; z-index: 99; padding: 10px;"></div>
<!-- Main Image -->
<img src="http://blog.svnlabs.com/wp-content/uploads/2009/06/svnlabs.jpg" border="0" alt="" align="absbottom" /></div>

We can use above code to map image using DIV elements on main image.
It is quite useful to insert hotspots on Images in FBML 😉

Maturity is not when we start speaking BIG things But..Actually it is, When we start understanding small things.