1

私は夢中になっていて、ユーザーが友人を選択して通知を送信したり、アプリケーションからウォールに投稿したりできるアプリケーション用のスクリプトを作成する方法を理解できません。

フラッシュゲームをプレイするように挑戦されたことを友人に通知する必要があるだけです。リンク付きの簡単なテキストだけです。派手なものは必要ありません:D

ここに私が試したものがありますが、うまくいきません:(理由はわかりません。

$message = 'Watch this video!';
 $attachment = array( 'name' => 'ninja cat', 'href' => 'http://www.youtube.com/watch?v=muLIPWjks_M', 'caption' => '{*actor*} uploaded a video to www.youtube.com', 'description' => 'a sneaky cat', 'properties' => array('category' => array( 'text' => 'pets', 'href' => 'http://www.youtube.com/browse?s=mp&t=t&c=15'), 'ratings' => '5 stars'), 'media' => array(array('type' => 'flash', 'swfsrc' => 'http://www.youtube.com/v/fzzjgBAaWZw&hl=en&fs=1', 'imgsrc' => 'http://img.youtube.com/vi/muLIPWjks_M/default.jpg?h=100&w=200&sigh=__wsYqEz4uZUOvBIb8g-wljxpfc3Q=', 'width' => '100', 'height' => '80', 'expanded_width' => '160', 'expanded_height' => '120')));
 $action_links = array( array('text' => 'Upload a video', 'href' => 'http://www.youtube.com/my_videos_upload'));
 $target_id = $user;
 $facebook->api_client->stream_publish($message, $attachment, $action_links, $target_id);

更新: appinclude.php

$facebook->redirect('https://graph.facebook.com/oauth/authorize?client_id=132611566776827&redirect_uri=https://apps.facebook.com/gamesorbiter/&scope=publish_stream');

私が得るエラー:

{
   "error": {
      "type": "OAuthException",
      "message": "Invalid redirect_uri: The Facebook Connect cross-domain receiver URL (https://apps.facebook.com/gamesorbiter/) must be in the same domain or be in a subdomain of an application's base domain (gamesorbiter.com).  You can configure the base domain in the application's settings."
   }
}

余分な「s」(http) がないと、次のエラーが発生します。

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

例を投稿できればお願いします。また、それを行うには拡張許可が必要ですか、それともユーザーがメッセージを送信した場合、それは必要ありませんか?

ありがとうございました

4

1 に答える 1

0

また、それを行うには拡張権限が必要ですか、それともユーザーがメッセージを送信した場合はそれはできませんか?

はい、ユーザーからのoffline_accessおよびpublish_stream拡張権限が必要です。

アップデート:

appinclude.phpファイルに、次のようなコードを配置します

$facebook = new Facebook($appapikey, $appsecret);
$user = $facebook->require_login();

$facebook->redirect('https://graph.facebook.com/oauth/authorize?
client_id=[YOUR APP ID]&
redirect_uri=[YOUR APP URL]&
scope=publish_stream, offline_access');

[YOUR APP ID]Facebook開発者セクションでサイトを作成したアプリケーション設定から確認できるアプリケーションIDに置き換えます。[YOUR APP URL]また、をアプリのURLに置き換えます。

于 2010-08-01T07:47:33.310 に答える