I did this in lens c, and I had a similar problem. Not sure if this will work well for quick.
The problem was that if for some reason the video had to be saved in NSDocumentDirectory or NSTemporaryDirectory so that it could work. Not if this is your case.
Although you can use FBSDKGraphRequest in the worst case with / me / Videos
I came to see how this video sharing method that you are trying to use is to get links directly from the photo library. As you can see in this example
Currently there is only an example in objective-c , hope this helps you
- (void)uploadVideoWithoutSettingsCredentials:(NSURL *)videoUrl withTitle:(NSString *)title withDesc:(NSString *)desc withPrivacy:(NSString *)privacy { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,0), ^{ NSError * error = nil; NSData * videoData = [NSData dataWithContentsOfURL:videoUrl options:0 error:&error]; NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:4L]; [params setObject:videoData forKey:[NSString stringWithFormat:@"%@.MOV",title]]; [params setObject:desc forKey:@"description"]; NSString *privacyString = @"EVERYONE"; if (privacy.length > 0) privacyString = privacy; NSDictionary *privacyDict = [[NSDictionary alloc] initWithObjectsAndKeys: privacyString, @"value", nil]; [params setObject:[Utils objectToJsonString:privacyDict] forKey:@"privacy"]; dispatch_async(dispatch_get_main_queue(), ^{ [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/videos" parameters:params HTTPMethod:@"POST"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"RESPONSE!!! /me/videos"); NSLog(@"result %@",result); NSLog(@"error %@",error); dispatch_async(dispatch_get_main_queue(), ^{ if (!error) { [[[UIAlertView alloc] initWithTitle:@"Success" message:@"Your clip was posted!" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil] show]; } else { [[[UIAlertView alloc] initWithTitle:@"Error!" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil] show]; } }); }]; }); }); }
You can upgrade to sintax fast using Xcode's autocomplete functionality.
You can help yourself a bit with the swift syntax with this
jose920405
source share