Facebook stream.publish ve eski şablon demetleri?

2 Cevap php

Aylardır facebook PHP API ile karıştırmasını denemedim. Şablon demetleri şimdi görünüşe göre feshedilmiş olduğundan, nasıl onların arkadaşları için benim kullanıcıların haber yem içine bir hikaye yayınlayabilirsiniz? Ben de zaten izinleri talep ettik.

Edit: Sorun Onlar verilen zaman kullanıcı için ayarlı değil istenen izinleri doğacak gibi görünüyor.

Şimdiye kadar bu var

$appapikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$appsecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$facebook = new Facebook($appapikey, $appsecret);
$fb_user = $facebook->require_login();

try {
    $facebook->api_client->feed_publishUserAction();
} catch(Exception $e) { }

Düzenleme: Ben facebook "API belgelerine" aracılığıyla birden çok kez baktım bu sadece benim için açık değil. Ben aslında önerilmemektedir ne söylemek ya da olamaz. Onlar eğitimlerini 2-3 yaş bağlantı!

Eğer iframe uygulama üzerinde tekrar ve tekrar yeniden bir sorun varsa kullanmayı deneyin

$facebook->require_frame()

2 Cevap

Zaten facebook wiki konuyu baktınız mı? http://wiki.developers.facebook.com/index.php/Stream.publish

Size yardımcı olmalıdır güzel bir örnek var. Değilse, sizin sorunun daha doğru tanımlamak gerekir.

EDIT: denetlemek ve bu gibi izinler için istek (ve ayrıca bunları talep) olabilir

function check_perms() {

    global $facebook, $uid;

    $data = $facebook->api_client->fql_query( "SELECT uid, publish_stream FROM permissions WHERE uid = " . $uid );
    if( $data[0]['publish_stream'] != true ) {
        echo '<br /><p>No \'publish_stream\' permissons found!<br />';
        echo '<fb:prompt-permission perms="publish_stream"> Allow me to publish to your wall (*click*) </fb:prompt-permission>';
        echo '<br />You\'ll have to refresh the page to continue.</p>';
        die();
    }

}
    <?php
          $message ="Your Message";
           $attachment = array( 
            'name' => 'Application Name or message', 
            'href' => 'http://apps.facebook.com/tshirtquote', 
            'description' => 'Choose/Write your T-shirt Quote, Get A Tshirt Free printed with your Favorite Quote',
            'media' => array(array('type' => 'image', 'src' => 'http://linkdoo.com/tshirtquote/images/tshirt1.JPG', 'href' => 'http://apps.facebook.com/tshirtquote/')), 
            ); 
           $action_links = array( array('text' => 'WriteYourTShirtQuote', 'href' =>   'http://apps.facebook.com/tshirtquote')); 
           $attachment = json_encode($attachment); 
           $action_links = json_encode($action_links);
           $message = json_encode($message);
      ?>
     <script>
     var attachment = <?= $attachment ?>;
     var message = <?= $message ?>;
     var action_links = <?= $action_links ?>;
     Facebook.streamPublish(message,attachment,action_links);

     </script>

Yukarıdaki komut kullanın, yayınlamak en kolay yoludur