Joel
Joel

Reputation: 308

How to show "via [my app name" when placing a "Like" button inside an app

I am trying to provide "Like" buttons INSIDE my Facebook app that will allow users to "Like" dynamic content for the purpose of advertising the app.

For this reason, when someone Like's and the post appears on their wall, I need to to say "via [My App Name] and the app's icon at the bottom of the post. However, with my current method, I'm seeing the post perfectly including the link to the external URL, but the App's name is not present.

The app runs by loading index.php from my Canvas URL. Index.php references:

< script src="https://connect.facebook.net/en_US/all.js#xfbml=1">

and $(document).ready does this:

            FB.init({
                appId       :   '[my app id]',
                status      :   true,
                cookie      :   true,
                xfbml       :   true
            });

then loads the content pages via Ajax into a blank div in the middle of the page.

The page loaded via Ajax contains numerous instances of the following:

< fb:like data-layout="button_count" href="[the url of my dynamic content]">

Then in $(document).ajaxComplete(), I do FB.XFBML.parse();

The dynamic page being linked to has the following tags:

    <meta property="og:title" content="my title" />
    <meta property="og:description" content="<?=$php_variable?>" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="[the url of this page]" />
    <meta property="og:site_name" content="site name" />
    <meta property="fb:app_id" content="[my app id]" />

Anybody see where I'm going wrong? If I missed posting any critical info, I'll be happy to - I'm just cross-eyed at this point and might have missed something.

Thank you in advance for your help!

Upvotes: 2

Views: 208

Answers (1)

Igy
Igy

Reputation: 43816

The Like button doesn't attribute the like to the app linked to the URL you're liking - there is no 'via' link - adding the app to the page is done so that the app can publish to users that like the page, manage the insights, etc

Upvotes: 1

Related Questions