GRiMe2D / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

add tags to photos #281

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I'm use this code:
var image:Object = {
access_token: fb.getSession().accessToken, 
tags: [],
fileName:'test', 
image:tmp
};

fb.api('/me/photos', handleUploadComplete, image, 'POST');

2. Upload photo without problem... but if i put parameters in array "tags: []" 
don't work!

3. I try objets, array, JSON and nothing work :S

Original issue reported on code.google.com by sguidob...@gmail.com on 29 Mar 2011 at 1:56

GoogleCodeExporter commented 9 years ago
i heard somewhere that the graph api doesnt support tagging a picture by 
uploading. you can do that by using the rest api.

Original comment by marc.storch@gmail.com on 30 Mar 2011 at 12:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi, I could solve it.
Send the information's to PHP using AMFPHP ... and since I could add tags
with PHP GRAPH API

PHP code:

function compartirFoto($archivo, $tags, $idFiesta)
    {
        include_once "fbmain.php";

        $tagged = array();

        for ($i = 0; $i < count($tags); $i++) {
            $tag = array(
                'tag_uid' => $tags[$i][4],
                'tag_text'=> $tags[$i][3],
                'x' => $tags[$i][1],
                'y' => $tags[$i][2]
            );
            if($tags[$i][4] != null || $tags[$i][3] != null){
                array_push($tagged, $tag);
            }
        }

        $image = array(
            'access_token' => $session['access_token'],
        );

        if (count($tagged) > 0) {
            $image['tags'] = $tagged;
        }

        $facebook->setFileUploadSupport(true);
        $image['image'] = '@'.realpath($archivo);

        $facebook->api('/me/photos', 'POST', $image);
        return "Success!";

    }

Original comment by sguidob...@gmail.com on 30 Mar 2011 at 12:52

GoogleCodeExporter commented 9 years ago
good! :)

Original comment by marc.storch@gmail.com on 30 Mar 2011 at 2:49

GoogleCodeExporter commented 9 years ago

Original comment by rovertn...@gmail.com on 31 Mar 2011 at 3:53

GoogleCodeExporter commented 9 years ago
Hola compañero.... aqui en este link encontrarás manera adecuada de utilizar 
Facebook.api para postear una foto y a la vez incluirle tags.

http://graciasinternet.blogspot.com/2011/05/tagear-fotos-con-facebookapi-en-as3.
html

El asunto que debes tener presente es que no se hasta cuantos tags se pueden 
por foto, o sino facebook con su codigo inteligente te elimina la aplicación.

Original comment by elkin0...@gmail.com on 13 May 2011 at 11:55