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.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
TO EXPLAIN MORE:
I want users to be able to access the app and be automatically logged into the app and stay logged in
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.
Hey, wonder if you tried apps like LoginRadius ? I am using it and it's easier than going through all these complicated APIs.
Does this code make/or cover the entire website having the user logged in?
Thank you for your response it's much appreciated =)