I’m building an iOS app that works with Google Drive documents using the GData framework. I can successfully retrieve and display documents from Google Drive, but I’m stuck on the file upload functionality.
The main issue is that when I try to get the upload URL using the postLink method, it returns nil. This prevents me from uploading any files to Google Drive. Here’s the code I’m using:
GDataFeedDocList *documentFeed;
Class entryClass = nil;
GDataEntryDocBase *newEntry = [entryClass documentEntry];
[newEntry setTitleWithString:self.fileName];
[newEntry setUploadData:self.fileData];
[newEntry setUploadMIMEType:mimeType];
[newEntry setUploadSlug:self.fileName];
NSURL *uploadURL = [[self.documentFeed postLink] URL];
NSLog(@"Upload URL: %@", uploadURL);
self.uploadTicket = [googleService fetchDocEntryByInsertingEntry:newEntry
forFeedURL:uploadURL
delegate:self
didFinishSelector:@selector(uploadComplete:finishedWithEntry:)
didFailSelector:@selector(uploadFailed:failedWithError:)];
The uploadURL variable is always nil, which makes the upload fail. Has anyone encountered this issue before? What could be causing the postLink to return nil?