okay i got it
it should be the following:
Facebook.ui("apprequests", { message:"select some friends" },
handleAppRequest, "iframe");
private function handleAppRequest(result:Object):void
{
for (var i:int = 0; i < result.request_ids.length; i++)
{
var requestID:String = result.request_ids[i];
Facebook.api("/" + requestID, handleRequestFriends);
}
}
private function handleRequestFriends(success:Object, fail:Object):void
{
if (success)
{
var values:Object =
{
access_token:Facebook.getSession().accessToken,
name:"This is my title",
link:"http://example.com",
picture:"
http://example.com/facebook/facebooktutorial/canvas/images/icon-75x75.gif",
caption:"this is a caption",
message:"This is a test message on " + new Date().toString()
};
var friendID:String = success.to.id;
Facebook.api("/" + friendID + "/feed", handleSubmitFeed, values,
URLRequestMethod.POST);
}
else
{
Debug.logObject(fail, this, "handleRequestFriends");
}
}
One question tho - can i use the facebook friend selector and just return
the results without the apprequest firing off to them?
thanks
a
On 15 April 2011 12:14, allandt bik-elliott (thefieldcomic.com) <
[email protected]> wrote:
> the documentation seems to say that it can:
>
> http://developers.facebook.com/docs/reference/dialogs/requests/
>
> <http://developers.facebook.com/docs/reference/dialogs/requests/>"The
> content of a request object looks like this and should be accessed using the
> signed app secret:"
>
> but it doesn't actually say how you would go about doing that (!!!)
>
> thanks in advance
> A
>
> On 15 April 2011 12:13, allandt bik-elliott (thefieldcomic.com) <
> [email protected]> wrote:
>
>> Hey
>>
>> Do you know if it's possible to retrieve user ids from the request_ids
>> array returned by the Facebook.ui("apprequests", ....) dialogue?
>>
>> I've tried the following:
>>
>> Facebook.ui("apprequests", { message:"select some friends" },
>> handleAppRequest, "iframe");
>>
>> which allows the selection of friends to tell about the app. I then do the
>> following:
>>
>> private function handleAppRequest(result:Object):void
>> {
>> for (var i:int = 0; i < result.request_ids.length; i++)
>> {
>> var requestID:String = result.request_ids[i];
>> Facebook.api("/" + requestID, handleRequestFriends);
>> }
>> }
>>
>> to select the friends returned in the result object (which I think might
>> be where I'm going wrong - i don't think that request_ids == facebook user
>> ids), and then this returns a fail:
>>
>> private function handleRequestFriends(success:Object,
>> fail:Object):void
>> {
>> if (success) trace("success");
>> else trace(fail);
>> }
>>
>> Thanks in advance
>> a
>>
>> On 15 April 2011 10:43, allandt bik-elliott (thefieldcomic.com) <
>> [email protected]> wrote:
>>
>>> hey guys
>>>
>>> found the problem(s) - i hadn't added the access_token to the params and
>>> it didn't like the actions{} object (although Facebook.ui was quite happy to
>>> accept it)
>>>
>>> wierd but true
>>>
>>> thanks for the help patrick
>>>
>>> best
>>> a
>>>
>>>
>>> On 14 April 2011 22:27, Patrick Matte <[email protected]>wrote:
>>>
>>>> I can only suggest you just use the Facebook API directly without using
>>>> that
>>>> AS3 api.
>>>>
>>>> So something like this.
>>>>
>>>> var urlRequest:URLRequest = new URLRequest("https://graph.facebook.com/"
>>>> +
>>>> userid + "/feed);
>>>>
>>>> var variables:URLVariables = new URLVariables();
>>>>
>>>> variables.access_token = token;
>>>>
>>>> urlRequest.variables = variables;
>>>>
>>>> var urlLoader:URLLoader = new URLLoader();
>>>>
>>>> urlLoader.load(urlRequest);
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Apr 14, 2011 at 1:14 PM, allandt bik-elliott (thefieldcomic.com)
>>>> <
>>>> [email protected]> wrote:
>>>>
>>>> > hi guys
>>>> >
>>>> > i'm having a bit of trouble with the facebook actionscript graph api
>>>> >
>>>> > While i can get posting to "/feed" to work with Facebook.ui, (does a
>>>> > facebook popup), i can't seem to get it to work with Facebook.api
>>>> >
>>>> > here is my code:
>>>> > var values:Object = {
>>>> > name:"This is my title",
>>>> > link:"http://example.com<
>>>> > http://www.google.com/url?sa=D&q=http://example.com>
>>>> > ",
>>>> > picture:"http://example.com/icon-75x75.gif<
>>>> > http://www.google.com/url?sa=D&q=http://example.com/icon-75x75.gif>
>>>> > ",
>>>> > caption:"this is a caption",
>>>> > description:"this is a long description",
>>>> > message:"This is a test message. There are many like it but
>>>> this
>>>> > one is mine.",
>>>> > actions:
>>>> > {
>>>> > name:"Crazy extra thing",
>>>> >
>>>> > link:"http://example.com<
>>>> > http://www.google.com/url?sa=D&q=http://example.com>
>>>> > "
>>>> > }
>>>> > };
>>>> >
>>>> > Facebook.api(_user + "/feed", handleSubmitFeed,
>>>> > values, URLRequestMethod.POST);
>>>> >
>>>> > this is called after Facebook.login() with the
>>>> > permissions "read_stream,publish_stream,user_likes" succeeds and the
>>>> id is
>>>> > stored in _user. I get the following error:
>>>> >
>>>> > [IOErrorEvent type="ioError" bubbles=false cancelable=false
>>>> eventPhase=2
>>>> > text="Error #2032: Stream Error. URL:
>>>> > https://graph.facebook.com/********/feed<
>>>> >
>>>> http://www.google.com/url?sa=D&q=https://graph.facebook.com/********/feed
>>>> >
>>>> > "]
>>>> >
>>>> > I'm not having any trouble with other calls to update the user's
>>>> status
>>>> > ("/statuses") or retrieving their friends list.
>>>> >
>>>> > Any ideas as to what the issue might be please?
>>>> >
>>>> > thanks
>>>> > a
>>>> > _______________________________________________
>>>> > Flashcoders mailing list
>>>> > [email protected]
>>>> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>> >
>>>>
>>>> This e-mail is intended only for the named person or entity to which it
>>>> is addressed and contains valuable
>>>> business information that is proprietary, privileged, confidential
>>>> and/or otherwise protected from disclosure.
>>>>
>>>> If you received this e-mail in error, any review, use, dissemination,
>>>> distribution or copying of this e-mail
>>>> is strictly prohibited. Please notify us immediately of the error via
>>>> e-mail to [email protected] and
>>>> please delete the e-mail from your system, retaining no copies in any
>>>> media. We appreciate your cooperation.
>>>> _______________________________________________
>>>> Flashcoders mailing list
>>>> [email protected]
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>
>>>
>>>
>>
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders