我正在开发一个需要显示 Picasa 网络相册中的照片的应用程序。我已经搜索过了。我得到了以下链接。 https://code.google.com/p/gdata-objectivec-client/
我已经下载了 GData 并将所有必需的文件夹包含在 xcode 中。
我写的代码在这里。
- (void) loadPhotoGallery{
username = @"xyz";
password = @"abc";
GDataServiceGooglePhotos *photosService;
photosService = [self photoService];
NSURL *url = [GDataServiceGooglePhotos photoFeedURLForUserID:@"user" albumID:@"ablumID" albumName:nil photoID:nil kind:nil access:nil];
GDataQueryGooglePhotos *introspectQuery;
introspectQuery = [GDataQueryGooglePhotos photoQueryWithFeedURL:url];
[introspectQuery setResultFormat:kGDataQueryResultServiceDocument];
GDataServiceTicket *ticket;
ticket = [photosService fetchFeedWithQuery:introspectQuery delegate:self didFinishSelector:@selector(introspectTicket:finishedWithServiceDocument:error:)];
}
- (void)introspectTicket:(GDataServiceTicket *)ticket
finishedWithServiceDocument:(GDataAtomServiceDocument *)serviceDoc
error:(NSError *)error {
if (error == nil) {
GDataAtomCollection *collection = [[serviceDoc primaryWorkspace] primaryCollection];
NSArray *theMIMETypes = [collection serviceAcceptStrings];
}
}
-(GDataServiceGooglePhotos *)photoService{
static GDataServiceGooglePhotos *service = nil;
username = @"xyz";
password = @"abc";
if (!service) {
service = [[GDataServiceGooglePhotos alloc] init];
[service setShouldCacheDatedData:YES];
[service setServiceShouldFollowNextLinks:YES];
[service setIsServiceRetryEnabled:YES];
}
if ([username length] > 0 && [password length] > 0) {
[service setUserCredentialsWithUsername:username
password:password];
} else {
// fetch unauthenticated
[service setUserCredentialsWithUsername:nil
password:nil];
}
return service;
}
但我对这段代码很困惑。
任何人都可以帮忙。如何开始获取照片的代码?
提前致谢。