Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-29-2010, 04:14 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
thistle is on a distinguished road
Default how to use ASIFormDataRequest setPostValue to tag Facebook images

I'm sending an image to Facebook from my iPhone app using the Graph API and ASIFormDataRequest. I want to set tags on the image.

Facebook docs say:
Quote:
tags: An array containing the users and their positions in this photo. The x and y coordinates are percentages from the left and top edges of the photo, respectively.
Photo - Facebook Developers

If I get info from Facebook on a previously tagged image, the tags look like this:

Code:
{
    from = "some name";
    height = 12345;
    
    ...
  
    tags =     {
        data =         (
	         		{
					"created_time" = "some time";
					id = 12345;
					name = "some name";
					x = "41.875";
					y = "35.4005";
				}
			);
	};
}
This is the rest of the request set-up code:

Code:
NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/photos"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request addData:UIImagePNGRepresentation(image) forKey:@"data"];
[request setPostValue:msg forKey:@"message"];
[request setPostValue:accessToken forKey:@"access_token"];
Where msg and accessToken are strings.

What should I be passing forKey:@"tags"? An array of a dicts? A dict of arrays of dicts? Some kind of comma separated string?

[request setPostValue:tags forKey:@"tags"];
where tags == ???

Thanks!
thistle is offline   Reply With Quote
Reply

Bookmarks

Tags
asiformdatarequest, facebook, images, setpostvalue, tagging

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 349
6 members and 343 guests
dre, freewind, hain, HemiMG, lendo, Newbie123
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:00 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0