Inorder your code to import contacts or friends or profile you need the below authentication file(oauth.html) on your project. This html file is necessary to authenticate the user on your website, please download and add it to your project.
//Add it inside the body tag <div class="socialinviter"></div>
<script type="text/javascript"> var licenses = "Your license key here"; //replace your license key var SIConfiguration = { "path": { "authpage": "http://localhost:60013/oauth.html" //replace the web url of oauth.html }, "callbacks": { "loaded": function (service, data) { //Contacts will be available in data object console.log(data); } } } </script>
<script type="text/javascript"> var fileref=document.createElement("script");fileref.setAttribute("type","text/javascript"); fileref.setAttribute("id","apiscript");fileref.setAttribute("src","//socialinviter.com/all-latest.js?keys="+licenses); try{document.body.appendChild(fileref);}catch(a){document.getElementsByTagName("head")[0].appendChild(fileref);} var loadInitFlg=0,socialinviter,loadConf=function(){window.setTimeout(function(){$(document).ready(function(){loadInitFlg++; socialinviter?socialinviter.load(SIConfiguration):15>loadInitFlg&&window.setTimeout(loadConf,200);})}, 250);};window.setTimeout(loadConf,200); </script>
<script type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script> <div class="socialinviter"></div> <script type="text/javascript"> var licenses = "Your license key"; //replace your license key var SIConfiguration = { "path": { "authpage": "http://localhost:60013/oauth.html" //replace the web url of oauth.html }, "callbacks": { "loaded": function (service, data) { //Contacts will be available in data object console.log(data); } } } var fileref=document.createElement("script");fileref.setAttribute("type","text/javascript"); fileref.setAttribute("id","apiscript");fileref.setAttribute("src","//socialinviter.com/all-latest.js?keys="+licenses); try{document.body.appendChild(fileref);}catch(a){document.getElementsByTagName("head")[0].appendChild(fileref);} var loadInitFlg=0,socialinviter,loadConf=function(){window.setTimeout(function(){$(document).ready(function(){loadInitFlg++; socialinviter?socialinviter.load(SIConfiguration):15>loadInitFlg&&window.setTimeout(loadConf,200);})}, 250);};window.setTimeout(loadConf,200); </script>
Note: sometimes you might get an error with callbackurl between www.xx.com and xx.com and between http://xx.com and https://xx.com, so carefull with www and https.