1

This is the method where we can share video to Instagram by saving the video to Camera Roll and using asset library url we can share it to Instagram app, provided Instagram is installed in the device.

 ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeVideoAtPathToSavedPhotosAlbum:self.shareURL completionBlock:^(NSURL *assetURL, NSError *error) {
            if (nil == error)
            {
              NSString *escapedString   = [assetURL.absoluteString URLEncode];
              NSString *escapedCaption  = [caption URLEncode];
              NSURL *instagramURL       = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@", escapedString, escapedCaption]];
              [[UIApplication sharedApplication] openURL:instagramURL];

            }
        } ];

Now I would like to know how can we achieve this using photoKit framework. Please help somebody.

rishu1992
  • 1,414
  • 3
  • 14
  • 33

0 Answers0