1

这是我们可以通过将视频保存到相机胶卷并使用资产库 url 将视频共享到 Instagram 的方法,我们可以将其共享到 Instagram 应用程序,前提是设备中安装了 Instagram。

 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];

            }
        } ];

现在我想知道我们如何使用 photoKit 框架来实现这一点。请帮助某人。

4

0 回答 0