Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » Facebook Connect integration in website

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1162 Views
  • kiwidude95
    Avatar
    Community Member
    25 Posts

    Facebook Connect integration in website Link to this post

    Hey there,
    Just wondering how I can leave my Facebook app connected to a user as soon as they launch the app and not click on LOGIN now and then.

  • kiwidude95
    Avatar
    Community Member
    25 Posts

    Re: Facebook Connect integration in website Link to this post

    TO EXPLAIN MORE:
    I want users to be able to access the app and be automatically logged into the app and stay logged in

  • tonibecker
    Avatar
    Community Member
    6 Posts

    Re: Facebook Connect integration in website Link to this post

    Hy buddy.
    At first you can't access your app without being logged in. In fact you need a so called access token for your app.
    To get more informations how to generate the token look here:
    https://developers.facebook.com/docs/opengraph/using-app-tokens/

    And here is a code example from my events_facebook import to get events from specific page and display it in silverstripe

    <?php
    require_once 'fb_api/facebook.php';

    // Authenticate
    $facebook = new Facebook(array(
       'appId' => 'your_app_id',
       'secret' => 'your_app_secret',
       'cookie' => true, // enable optional cookie support
    ));

    // Attempt to fetch SpiritGallery's events page
    // place access token for your fanpage after events?access_token=
    // also place your fanpage that you would like to pull events from in $events=$facebook->api('/fanpage_here/
    try{
       $events=$facebook->api('/radionationband/events?access_token=copy_your_token_here');
    }catch (FacebookApiException $e){
       error_log($e);
    }

    // Iterate through each event
    foreach ($events["data"] as $event){

    I hope this helps for the first time.

  • Fionna
    Avatar
    Community Member
    1 Post

    Re: Facebook Connect integration in website Link to this post

    Hey, wonder if you tried apps like LoginRadius ? I am using it and it's easier than going through all these complicated APIs.

  • kiwidude95
    Avatar
    Community Member
    25 Posts

    Re: Facebook Connect integration in website Link to this post

    Does this code make/or cover the entire website having the user logged in?
    Thank you for your response it's much appreciated =)

    1162 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.