Jump to content

Facebook Events


justb3a
 Share

Recommended Posts

Been looking at the issue, as i have this being used on 3 sites; none of the sites are displaying events anymore, clients not too happy (:()...

The module itself though is doing it's job, so nothing wrong with the module; rather, the feeds are returning an empty array; we can only assume that this is something to do with Facebook new security, however even looking through the app settings and documentation, can't see how to debug this through facebook..

UPDATE:

I saw this announcement here https://www.codeofaninja.com/2011/07/display-facebook-events-to-your-website.html

Quote

 

We reached out to Facebook and they said that certain Facebook API features are temporarily down due to the changes they are making to the Facebook platform.

We digged into the new API documentation, and it says that once the Facebook changes were done, they will require the users of Events API to use a reviewed and approved FB application.

In other words, it will be harder to display FB page events because FB has to review your app first to make your access token work.

 

Guess we're waiting for FB at this point...

  • Thanks 1
  • Sad 1
Link to comment
Share on other sites

  • 3 months later...

I have the same issue, no FB Events displaying since the new Facebook API updates. However, I found a temporary workaround:

 

Temporary Workaround to make Facebook-Events module work again

Cons:

  • unclear future support
  • needs manual token generation every two months
  • needs small change in module

Pro:

  • it works, at least for now ?

This solution uses an extended custom User Access Token instead of the Access Token created by the module.

Step 1

Go to https://developers.facebook.com/tools/explorer and choose the app you’ve created. Click on Get Token -> Get User Access Token. Uncheck all permissions, especially user_friends (this was selected by default for me) since the API changes need apps to be reviewed by Facebook to grant access to this. Check only the pages_show_list permission! Click on Get Access Token. Now, a generated Access Token should appear in the Access Token field.

You can test if this token works by testing the following api syntax (empty field under Access Token field): 

your-page-id/events/?fields=id,name,timezone,start_time,end_time,description,place,cover

Replace your-page-id with your actual page id. You should get a JSON with all your page events in the response field.

Step 2

By default, this generated token is only valid for a few hours. To change this, click on the blue round Info-button next to the Access Token. Click Open in Access Token Tool. In the Access Token Tool, click on Extend Access Token. Now, your Access Token should be valid for two months. After that, you have to repeat this process!

Step 3
By default, in the Facebook-Events module settings (admin/module/edit?name=FacebookEvents), the config field for the Facebook Access Token is hidden. To change that, go to the FacebookEventsConfig.php file of the module, and on line 74, comment out the following line:

...
...
$field->collapsed = Inputfield::collapsedHidden; // COMMENT OUT THIS LINE!
...

Upload the modified FacebookEventsConfig.php file and refresh the Facebook-Events module settings. Now, the Facebook Access Token field should be visible. Replace this Access Token with the one you generated before! Now, everything should work again.

-----------------------------------------------------------------

Please let me know if this worked for you. Let's see how long this will continue to work ?

Also, when using this method, don't forget to renew your Access Token every two months!

If somebody is able to modify the module to solve this programmatically, that would be awesome!

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
On 7/21/2018 at 7:47 PM, silvestro said:

....

Please let me know if this worked for you. Let's see how long this will continue to work ?

Also, when using this method, don't forget to renew your Access Token every two months!

Hi Silvestro,

if You use Facebook Graph API for PHP you can take a new Long Live Access Token like this:

// $fb = new \Facebook\Facebook(...) 
// get fresh Access Token before current Access Token expire
$newLongLiveUserAccessToken = $fb->getOAuth2Client()->getLongLivedAccessToken($savedAccessToken);
$newAccessTokenToSave = $newLongLiveUserAccessToken->getValue();

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...