Integrera Facebook

To start with the configuration, you have to get a Facebook developer account so you could use API credentials.
 
NOTE: If your facebook account is not verified, you won't be able to create any facebook app.
NOTE 2: You must have a facebook page in order to be able to fetch posts, comments from it via the facebook app you create.
 
Login to your Facebook account and then navigate to http://developers.facebook.com/ and click Apps > Add a New App in the top menu.
 
 
After you click "Add a New App" a popup shows up where you are supposed to choose what type of applicaiton you want to create. Choose the "Website" type.
 
After you click "Website" you will be prompted to choose a name for your new application, use e.g. "Connector" or whatever you like to and click "Create New Facebook App ID".
 
In the next screen you need to set some initial settings for your application. Select settings like you see in the following picture: select category "Apps for Pages" and NO, because this is not a test version of another app. Than click the "Create App ID" button in the lower right hand corner.
 
In the following screen of the configuration wizard, you can click "Skip Quick Start" in the top right hand corner. All the settings can be set in the configuration later.
 
After you click "Skip Quick Start" the Dashboard page of your App shows up:
 
In this Dashboard notice the  App ID and Secret fields. Next to the Secret field you will have to click the 'Show' button so that you receive the Secret key. 
You will need both App ID and Secret key later on when configuring the Facebook App inside LiveAgent.
 
Now, choose the "Settings" menu and fill in the "App Domains" field with the name of the domain of your LiveAgent installation. Only website from this domain will be able to use the Facebook app. You must fill also "Contact Email" with a valid email address.
Note: if you don't have a domain name, only an IP address, just leave the App Domains blank. If you try to set App Domains to an IP address, it will show the following error: "This must be derived from Canvas URL, Secure Canvas URL, Unity Binary URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains: ..."
 
Still in that Settings screen (Basic tab) click "Add Platform". Once you click it, you will see a screen like this:
 
There you have to click "Website".
 
After you clicked "Website", you will see the Settings screen (Basic tab) again and the "Website" section in it:
 
Now, in that "Website" section you must fill in the "Site URL" field. The Site URL must be the URL address leading to your installation of LiveAgent, including the protocol (http:// or https://). The value should look like "http://some-example-domain.com/".
 
Now switch to "App Details" section (click App Details in the left hand column).
You need to fill in the fields Short descriptionLong descriptionPrivacy policy URL and you need to add at least one App Icon.
Short description e.g. "LiveAgent connect application", Long description e.g. "FB application used by LiveAgent web application to read from user's FB pages and page messages and reply to page posts and page messages" and Privacy policy URL e.g. "http://www.liveagent.se/liveagent-integritetspolicy-privacy-policy/" (you can use this same URL as it is valid for all LiveAgent installations). If you don't have an icon you can use the LiveAgent image attached at the end of this article.
 
 
 
In the Status section, you need to make it public or your messages in chat to your customers will be marked by Facebook as spam. This setting is in the "Status & Review" section and switch the application switch to YES.
 
 
So, right now you are ready to start with the activation of Facebook plugin of your LiveAgent application.
 
In your LiveAgent navigate to Configuration > Facebook and click Enable Facebook
 
 
After refresh of the application the "Enable Facebook" button changes to Connect with Facebook
 
 
After clicking Connect with Facebook you will see a screen like this one:
 
Into the App ID field enter the App ID  and into the App Secret enter the Secret key you found in the "Dashboard" when creating the Facebook app.   Then click  Save.
 
Afterwards at Configuration > Facebook a "Pages" menu item will show up where you can  connect your LiveAgent with all the Facebook pages which you administrate (admin role in Facebook page).
 
 
You will either get a facebook login screen, or if you are already logged in  with a facebook account, then you will see a screen like this one:
 
where you can choose the level of privacy (by default is 'Friends') and where you have to click "Okay"
 

 
After you have set up LiveAgent to connect to Facebook, you can proceed to the last step - submitting Facebook application for review. 
 
By default all Facebook apps are granted permissions: emailpublic_profile and user_friends. LiveAgent needs some special permissions to read and post to pages and page private messages and therefore you will need to request these permissions and submit your application for approval.
 
The process of submitting your Facebook application for review is described step-by-step in another article How to submit Facebook application for review.