Facebook post with options

I need to make a Facebook post with options. I used the solutions from here: Dynamically generates Facebook Open Graph meta tags and here: Dynamic Facebook and meta tags in Wordpress PHP

FINAL OPERATING CODE:

<?php $params = array(); if(count($_GET) > 0) { $params = $_GET; } else { $params = $_POST; } // defaults if($params['title'] == "") $params['title'] = "default_title"; if($params['score'] == "") $params['score'] = "1234567"; ?> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# pathoflight: http://ogp.me/ns/fb/pathoflight#"> <meta property="fb:app_id" content="MY_APP_ID" /> <meta property="og:type" content="pathoflight:level" /> <meta property="og:url" content="<?php echo 'https://path-of-light.herokuapp.com'.$_SERVER['REQUEST_URI']; ?>"/> <meta property="og:image" content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> <meta property="og:title" content="<?php echo $params['title']; ?>" /> <meta property="pathoflight:score" content="<?php echo $params['score']; ?>" /> </head> 

It works fine in browser and Facebook Debugger, but my posts via Facebook API always lead to default values ​​for title and score . How can I tell Facebook to read my real settings?

+2
php facebook facebook-graph-api
Mar 13 '13 at 6:34
source share
1 answer

The problem is also that the Facebook API skips parameters if you make a message like this

 me/pathoflight:complete?level=https://path-of-light.herokuapp.com/level_new.php?title=my_title&score=223322 

This approach works:

 me/pathoflight:complete Add a field level https://path-of-light.herokuapp.com/level_new.php?title=my_title&score=223322 
0
Mar 13 '13 at 13:50
source share



All Articles