Facebook JavaScript SDK over HTTPS loading non-secure items

TL;DR set FB._https to true before calling FB.init. Like so: FB._https = true; FB.init({ /* your app id and stuff */ }); Explanation If you unminify the Facebook JavaScript SDK, you’ll see that its basically an object literal with a bunch of properties. One of these properties is _https, which is a boolean. This property … Read more

Implement Facebook API login with reactjs

I have figured out how to modify the Facebook tutorial for the Login API with ReactJS. Firstly, in the react component where you want the Login link, include this code: componentDidMount: function() { window.fbAsyncInit = function() { FB.init({ appId : ‘<YOUR_APP_ID>’, cookie : true, // enable cookies to allow the server to access // the … Read more

Using “share_open_graph” Facebook UI to create dynamic share dialog for quiz results

I have done with share_open_graph method with object like this,, FB.ui({ method: ‘share_open_graph’, action_type: ‘og.shares’, action_properties: JSON.stringify({ object : { ‘og:url’: ‘http://astahdziq.in/’, // your url to share ‘og:title’: ‘Here my custom title’, ‘og:description’: ‘here custom description’, ‘og:image’: ‘http://example.com/link/to/your/image.jpg’ } }) }, // callback function(response) { if (response && !response.error_message) { // then get post content … Read more

Invalid version specified, facebook share plugin error

I was also getting the following error even when using the standard embed code that Facebook provides. Uncaught Error: invalid version specified in sdk.js The first thing to check is that you’re including the version number in your FB.init call: FB.init({ appId: ‘your-app-id’, xfbml: true, version: ‘v2.8’ }); The now-outdated fix… …was to make a … Read more

How to get access token from FB.login method in javascript SDK

You can get access token using FB.getAuthResponse()[‘accessToken’]: FB.login(function(response) { if (response.authResponse) { var access_token = FB.getAuthResponse()[‘accessToken’]; console.log(‘Access Token = ‘+ access_token); FB.api(‘/me’, function(response) { console.log(‘Good to see you, ‘ + response.name + ‘.’); }); } else { console.log(‘User cancelled login or did not fully authorize.’); } }, {scope: ”}); Edit: Updated to use Oauth 2.0, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)