views:

45

answers:

0

Here is my stream publish code that publish some infomation (attachment, media) to Facebook wall post:

function afterAcceptPublish(to_id){
            var postid;
            var attachment = { 
                'name': 'ฉันได้รับของขวัญเนื่องในวันอีดิ้ลฟิตรี่จาก <?= $card['name']; ?> แล้ว', 
                'href': '<?= APP_BASE_URL; ?>/eid_mubarak/', 
                'caption': '', 
                'description': 'ฉันได้รับของขวัญจาก <?= $card['name']; ?> เนื่องในวันอีดิ้ลฟิตรี่ ประจำฮิจเราะห์ศักราชที่ 1431. ขอให้อัลลอฮฺเจ้าจงตอบแทนความดีของเรา และของท่านด้วย',
                'media': [{ 
                    'type': 'image', 
                    'src': 'http://www.muslimsquare.com/applications/eid_mubarak/images/publish_send_icon.png', 
                    'href': '<?= APP_BASE_URL; ?>/eid_mubarak/'}] 
            }; 

            var action_links = [{
                                'text':'Send your gift',
                                'href':'<?= APP_BASE_URL; ?>/eid_mubarak/'
                                }];
            postid = FB.ui({
                method: 'stream.publish',
                display: 'popup',
                message: 'getting educated about Facebook Connect',
                attachment : attachment,
                target_id : to_id,
                uid : to_id,
                action_links : action_links
            },
            function(response){
                if (response && response.post_id) {
                    //alert('Post was published.');
                } else {
                    //alert('Post was not published.');
                }
            });
            return postid;
        }

Notice that parameter to_id is some uid from Facebook user.

This code is working when I post something to my friends, but when I put my uid to to_id Facebook popup

alt text

instead of

alt text

Facebook just show about user update status but not attach some media to that link.

What is wrong, and how can I fix it?