I created a Pdf file which prints and emails without any problems and im trying to upload to my dropbox apps folder. This is my first dropbox App and I need help please.
I keep getting this error : -1: linker command failed with exit code 1 (use -v to see invocation)
My Code is as follows:
Appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
//Begin Dropbox
[DBClientsManager setupWithAppKey:@<APP_KEY_REDACTED>];
DBUserClient *client = [[DBUserClient alloc] initWithAccessToken:@<ACCESS_TOKEN_REDACTED>];
return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
DBOAuthResult *authResult = [DBClientsManager handleRedirectURL:url];
if (authResult != nil) {
if ([authResult isSuccess]) {
NSLog(@Success! User is logged into dropbox.);
} else if ([authResult isCancel]) {
NSLog(@Authorization flow was manually canceled by user!);
} else if ([authResult isError]) {
NSLog(@Error: %@", authResult);
}
}
return NO;
}
Viewcontroller.m
DBUserClient *client = [DBClientsManager authorizedClient ];
NSData *fileData = [@yourPDF.pdf dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
[[[client.filesRoutes uploadData:@/test/path/in/Dropbox/account/yourPDF.pdf
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
strictConflict:nil
inputData:fileData]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (result) {
NSLog(@%@\n", result);
} else {
NSLog(@%@\n%@\n", routeError, networkError);
}
}] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedUploaded) {
NSLog(@\n%lld\n%lld\n%lld\n, bytesUploaded, totalBytesUploaded, totalBytesExpectedUploaded);
}];