I faced an issue with facebook that how can i set the access_token as permanent. So here are the steps to achieve this.
Step 1 – Crate Page in Facebook like,
Step 2 – Create Facebook App from Here
Go to Apps Section and if you are not Registered as Developer then fist Register as Developer and then click on Create App.
Step 3 – Specify App Name etc detail you will be redirected to below screen
Step 4 – Assign Permissions to App like,
Now Your App and Page both are created.
Step 5 – hit below link with the parameters specified
where App ID will be the Application ID (you can get it from Step – 3) and on editing the created page, will give you facebook page id as show below.
Step 6 – Get Short- lived access_token and allocate “manage_pages” permission to it using below link with parameters
Step 7 – Generate Access_token from “Graph API Explorer” option and give permissions to it – “manage_pages,publish_stream” in Extended Permission section. Now click on Submit will show you the account detail. At this time by using this access_token in link “Access Token Debugger” will show you that Expiration is of an hour only.
Take this generated access_token and use in below link.
This will may show you the error like “Invalid Verification Code” etc like…. don’t worry.
Step 8 – Use the below to Generate access_token which says Expires -> Never 🙂
This link will give you a new access_token use that access_token in link “Access Token Debugger” will show you that Expiration = (in 2 months) which after few mins will show you below screen where Expiration = Never 🙂