DatBear
DatBear

Reputation: 139

Facebook Embed API Multiple Photo Post

When using Facebook's Embedded Posts API, any post that has multiple photos on it is not rendering correctly when the user is logged in to Facebook. Everything shows up fine if no user is logged in. I have tested this in both Firefox (v43.0) and Chrome (v47.0.2526.80 m) and it happens in both places.

Here is the html I'm testing with, in the body (I obviously replaced the app-id with my app-id. The first post has multiple images, the 2nd only has one. When not logged into facebook both posts render correctly. After logging into facebook, the first post fails to render and leaves a blank space on the page, the second still renders correctly.

<div>
    <div class="fb-post" data-href="http://facebook.com/106536536125/posts/10153158906711126" data-width="400"></div>
    <div class="fb-post" data-href="http://facebook.com/106536536125/posts/10153157143376126" data-width="400"></div>
</div>
<div id="fb-root"></div>

<script>
    window.fbAsyncInit = function() {
        FB.init({
            appId: 'your-app-id',
            xfbml: true,
            version: 'v2.5'
        });
    };

    (function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) {
                    return;
                }
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_US/sdk.js";
                fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

Is this a bug in the embed code for Facebook posts, or is there something I can do to fix it?

Upvotes: 0

Views: 181

Answers (1)

DatBear
DatBear

Reputation: 139

I filed a bug report with Facebook and they confirmed this is a bug and they're starting to work on it.

Upvotes: 1

Related Questions