Currently nothing happens when I run my code.
This is how I am setting the up client. I did not put the client set up in my viewDidLoad method because this class will never be shown it just handles server side actions.
(instancetype)initWithClient
{
self = [super init];
if (self) {
self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
}
return self;
}
This is how I make the API call to upload
(void)uploadToDropBox:(UIImage *)img
{
NSLog(@"Entered the DB upload method");
NSArray *directories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *documentDirectory = [directories firstObject];
NSString *imagePath = [documentDirectory stringByAppendingPathComponent:@"cardImage"];
NSString *destDir = @"Apps/BirthdayScrapbook";
NSLog(@"Just about to execute the upload method");
NSData *imageData = UIImagePNGRepresentation(img);
[imageData writeToFile:imagePath atomically: YES];
[self.restClient uploadFile:@"cardImage" toPath:destDir withParentRev:nil fromPath:imagePath];
NSLog(@"Executed the DB upload method");
[self sendBDayCard];
}
I think I am going about it wrong. I know what my access token is, but I don't know what to do with it nor where to put it. There is a client init method that takes in the userID, but I don't know where to find my accounts userID. Can someone give some direction with this?