简体   繁体   中英

upload photo to Facebook from flash mobile project using as3

i am currently developing android application... i want to upload photo to facebook from my application...

i am using this.. but it is to share the link... what i want is to upload photo and message only which user can see whole message in the post. Please help me!!!

Below is my code:

var appId:String = appId;
        var messageTitle:String =title;
        var messageUrl:String = link;
        var messageDescript:String = message;
        var appThumb:String = imageUrl;
        var redirectUrl:String = "https://www.facebook.com";

        var URLString:String = "https://www.facebook.com/dialog/feed?app_id="+appId+"&link="+messageUrl+
                                "&description="+messageDescript+"&name="+messageTitle+"&picture="+appThumb+
                                "&redirect_uri="+redirectUrl;

        var req:URLRequest = new URLRequest(URLString);

        try{navigateToURL(req,"_blank"); }

        catch (e:Error){ trace(">> ERROR <<", e.message); } 

U can use a AS3 API for Facebook, it could make your job easier ( API AS3 FB )

After FB inizialize and fb login u can use this code

var params:Object = { url:url, message:description, fileName:url_or_filename};
Facebook.api('me/photos', Function_callback , params , 'POST');

But if u want only use Graph URL u need this method https://graph.facebook.com/USER_ID/photos . You can see more informations and parameters about POST photos HERE

Hope This help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM