Estou utilizando a GraphAPI_Mobile_1_8_1.swc para enviar fotos no
facebook atraves de um aplicativo mobile feito no flex 4.6, porém está
dando erro ao postar, mas nao consigo identificar, alguem pode me
ajudar ?
abaixo o codigo de como estou fazendo....
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="
http://ns.adobe.com/mxml/2009"
xmlns:s="library://
ns.adobe.com/flex/spark" title="_foto"
creationComplete="init(event)">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here
-->
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.facebook.graph.FacebookMobile;
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
public var permissions:Array =
["user_photos","user_birthday","read_stream","publish_stream"];
public function init(event:FlexEvent):void{
FacebookMobile.init("minha ID",onLogin);
}
protected function postPhoto():void {
var values:Object = {message:'mobiFace',
fileName:'FILE_NAME',image:imgUser};
FacebookMobile.api('/me/photos', handlePhoto, values,'POST');
}
protected function handlePhoto(response:Object, fail:Object):void
{
imgUser.source = null;
lblStatus.text = (response) ? 'Foto postada com sucesso' : 'Erro
ao postar';
}
]]>
</fx:Script>
<s:Image id="imgUser" x="10" y="10" width="157" height="117"
source="image/facebook (6).png"/>
<s:Label id="lblStatus" x="9" y="219" />
<s:Button x="10" y="147" width="157" label="Post photo"
click="{postPhoto()}"/>
</s:View>
para postar estou carregando uma imagem qualquer no Image...
mas retorna Erro ao postar conforme a function handlePhoto...e não
consigo saber o porque....