0

Creating Facebook Connection

Did anybody knows how to create a facebook connection to work in TV Widget?

by
4 Replies
  • QUOTE (Sanny M @ May 22 2009, 02:07 PM) <{POST_SNAPBACK}>
    Did anybody knows how to create a facebook connection to work in TV Widget?


    This is an extremely open ended question. Can you provide more details on what you are trying to accomplish and what results you are seeing if any?

    -Jeremy
    0
  • QUOTE (Jeremy Johnstone @ May 22 2009, 02:54 PM) <{POST_SNAPBACK}>
    This is an extremely open ended question. Can you provide more details on what you are trying to accomplish and what results you are seeing if any?

    -Jeremy


    I am trying to create a widget that enable user to login to their facebook accounts, which we will retrieve their friends and contacts. So that from this widget, user will be able to post message or send a gift to their facebook friends.
    I am aware that there are no facebook API for TV widget platform, so I am trying to use their Javascript facebook API since that is the closest one that we could get.

    But there are some problems because the API try to access the "window" object and also try to write a cookie. I am able to take the login method on that API and try to do a simple login, but the result that i get is that "Cookie is not enabled". Is there a configuration that i could change to make it accepting a cookie.
    Here are the code that i use :
    CODE
    			var request = new URL();
    var params = "api_key=XXXSOMEKEYXXXX" +
    "&charset_test=€,´,€,´,水,Д,Є" +
    "&email=XXXXXXX" +
    "&pass=XXXXXXX" +
    "&return_session=1" +
    "&version=1.0";
    request.location = "https://login.connect.facebook.com/login.php?login_attempt=1";
    request.setRequestHeader("Accept","application/xml");
    request.postData = params;
    request.callback = function(response){
    log ("RESULT FROM FB = ");
    log (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    log(response);
    log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    }
    request.fetchAsync( function(u) {
    KONtx.utility.WaitIndicator.down();
    log( " < FBI [" + u.response + "] :: " + u.location );
    if ( u.response == 200 ) {
    KONtx.messages.store("noNetwork", false);
    u.callback( u.result );
    }
    else {
    KONtx.messages.store("noNetwork", true);
    log('\n%%% API: bonk! %%% --- http response --->' + u.response + "\nResult:\n" + u.result);
    }
    } );


    I copy and paste the response to a browser, and it displayed that Cookie is not enabled.

    I believe this also replying this topic http://developer.yahoo.net/forum/index.php?showtopic=973

    Thanks,
    0
  • I am trying to create a widget that enable user to login to their facebook accounts, which we will retrieve their friends and contacts. So that from this widget, user will be able to post message or send a gift to their facebook friends.
    I am aware that there are no facebook API for TV widget platform, so I am trying to use their Javascript facebook API since that is the closest one that we could get. But there are some problems because the API try to access the "window" object and also try to write a cookie.
    [/quote]


    Their Javascript API requires a web browser to operate. It is not compatible with the TV widget environment.



    QUOTE (Sanny M @ May 22 2009, 03:32 PM) <{POST_SNAPBACK}>
    I am able to take the login method on that API and try to do a simple login, but the result that i get is that "Cookie is not enabled". Is there a configuration that i could change to make it accepting a cookie.
    Here are the code that i use :
    CODE
    			var request = new URL();
    var params = "api_key=XXXSOMEKEYXXXX" +
    "&charset_test=€,´,€,´,水,Д,Є" +
    "&email=XXXXXXX" +
    "&pass=XXXXXXX" +
    "&return_session=1" +
    "&version=1.0";
    request.location = "https://login.connect.facebook.com/login.php?login_attempt=1";
    request.setRequestHeader("Accept","application/xml");
    request.postData = params;
    request.callback = function(response){
    log ("RESULT FROM FB = ");
    log (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    log(response);
    log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    }
    request.fetchAsync( function(u) {
    KONtx.utility.WaitIndicator.down();
    log( " < FBI [" + u.response + "] :: " + u.location );
    if ( u.response == 200 ) {
    KONtx.messages.store("noNetwork", false);
    u.callback( u.result );
    }
    else {
    KONtx.messages.store("noNetwork", true);
    log('\n%%% API: bonk! %%% --- http response --->' + u.response + "\nResult:\n" + u.result);
    }
    } );


    I copy and paste the response to a browser, and it displayed that Cookie is not enabled.

    I believe this also replying this topic http://developer.yahoo.net/forum/index.php?showtopic=973



    Taking the code from their Javascript API which is designed to run in a browser and trying to retrofit it into the widget engine is going to be a difficult task at best (if even possible at all). I apologize, but this is not something which is feasible at this time to implement, IMHO, using the current APIs provided for Facebook Connect.
    0
  • Also, placing your API Key inside any application it prohibited by Facebook and a HUGE security risk.

    Please make sure to consult all the warnings around the API usage in the Facebook documentation.
    0

Recent Posts

in General - Yahoo! TV Widgets