Title: OAuth2Client Error
Last modified: April 18, 2017

---

# OAuth2Client Error

 *  Resolved [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/)
 * Hi,
 * When clicking on the update button within the plugin I receive the following 
   error:
 * Fatal error: Call to undefined method Facebook\Authentication\OAuth2Client::getCodeFromAccessToken()
   in /var/sites/t/thebullcolchester.co.uk/public_html/wp-content/plugins/eme-sync-
   facebook-events/eme-sync-facebook-events.php on line 138
 * I have log out/in from the plubin page and checked my App ID, App Secret and 
   page ID.
 * Any idea as to what the issue may be before I go on the hunt for anew plugin.
 * Thanks

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9040626)
 * Seems to me you have multiple facebook-things running, all with their own facebook
   classes (and that will break things I guess). The function getCodeFromAccessToken
   is in the facebook class-code I provide with EME.
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9040681)
 * If only if it were so simple, no other facebook functionality on the site. I 
   have disabled all other plugins but EME and EME facebook sync. All was working
   fine and I have mad no changed to the site.
 * L
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9040733)
 * This is weird then … if that function is missing, I wonder how it ever could’ve
   worked 🙂
    Let me see that by accident I didn’t forgot to include newer facebook
   files in the released version …
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9040784)
 * It seems indeed there’s an error in that section of the code, no idea why nobody
   reported that sooner … I’ll check it out this evening.
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9040805)
 * Quick try, could you change the 3 lines 138-140 in eme-sync-facebook-events.php
   to:
 *     ```
                               $code = $oAuth2Client->getCodeFromLongLivedAccessToken($facebook_session);
                               $facebook_session = $oAuth2Client->getAccessTokenFromCode($code);
                               update_option('eme_sfe_fb_access_token',$facebook_session);
       ```
   
 * ?
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9041096)
 * Thanks Franky that seems to have done the trick.
 * L
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9041121)
 * OK carried out a full refresh, it does not seem to be removing deleted events
   from the DB when a full sync is carried out. Is there anyway to nuke all events
   and re-sync?
 * L
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9041562)
 * Go into the EME admin interface and delete the events.
    Or go into the EMEFS 
   settings and unselect “Skip synced events and locations”
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9045103)
 * Great, thanks for all your help
 * L

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘OAuth2Client Error’ is closed to new replies.

 * ![](https://ps.w.org/events-made-easy/assets/icon-256x256.png?rev=1856035)
 * [Events Made Easy](https://wordpress.org/plugins/events-made-easy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-made-easy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-made-easy/)
 * [Active Topics](https://wordpress.org/support/plugin/events-made-easy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-made-easy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-made-easy/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/oauth2client-error/#post-9045103)
 * Status: resolved