테스트 할 앱이 없지만 php-curl 솔루션을 this SO question에서 번역했습니다.
NSString *authCode = [NSString stringWithFormat:@"GoogleLogin auth=",@"ACCESS CODE FROM OAUTH2"];
NSString *userId = @"USER ID GOES HERE";
NSString *albumId = @"ALBUM ID GOES HERE";
NSString *albumUrl = [NSString stringWithFormat:@"https://picasaweb.google.com/data/feed/api/user/%@/albumid/%@",userId, albumId];
// To get the data from a PNG file
NSData *postData = UIImagePNGRepresentation([UIImage imageNamed:@"YOUR IMAGE"]);
// To get the data from a JPEG file
//NSData *postData = UIImageJPEGRepresentation([UIImage imageNamed:@"YOUR IMAGE"], 0.9f);
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
// Init and set fields of the URLRequest
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setHTTPMethod:@"POST"];
[request setURL:[NSURL URLWithString:[NSString stringWithString:albumUrl]]];
[request setValue:@"image/jpeg" forHTTPHeaderField:@"Content-Type"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"2" forHTTPHeaderField:@"GData-Version"];
[request setValue:authCode forHTTPHeaderField:@"Authorization"];
[request setHTTPBody:postData];
NSURLResponse* rep = nil;
NSError *err = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&rep error:&err];
if (data && !err) {
//Do something with the response
}
희망이 있습니다.
와트는 인증 코드 – Chandru
입니다. 감사합니다. 내가 첵하고 알리십시오. – Chandru
우물 .. 미안합니다. 앨범을 만드는 것입니다. 대답을 편집했습니다 – user1349663