a digital blog


Share on Facebook to Unlock the Download Button


This post explains you about how to code Share on Facebook to Unlock the Download Button script. So for this first of all you need to create a facebook app, because to implement we need a facebook app id. So here is steps to create an facebook apps.

Demo & Download Link

  • Go to http://developer.facebook.com/
  • In top menu click to ”Create a New App”  under App link.
  • Fill the form details
  • Go to Settings and in App Domains enter website domain name
  • Click to Add Platform and select website, and in Add Platform enter your website url with “/” at the end and click to Save Changes and note down App ID. Now your app is ready.Share on Facebook to Unlock the Download Button

Add this code after your <body> tag

<div id="fb-root"></div>
<script type="text/javascript"
<script type="text/javascript">
 appId : '147823442054624',
 status : true,
 cookie : true,
 xfbml : true

Here is javascript function that is the core function for this script.

function shareToDownload(){
    method : 'feed',
    name : "Share Title",
    link : 'Share Link',
    picture: 'Share Image',
    caption: "Share Caption",
    description: "Share Description",
    message: "Share Message"
 }, function(response){
   if (response && !response.error_code) {
     /*Write your download code here*/


  1. very good blog content. It deserves to share.

  2. Waqas Khan

    very nice info, thanks for informing people like me

  3. do you think this will help us

  4. Does it work for ghost blogs and wordpress?

Cancel reply


Copyright © 91 Web Lessons - a digital blog