使用挂钩在Instagram上发布视频 [英] Posting video on instagram using hooks

查看:114
本文介绍了使用挂钩在Instagram上发布视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的应用能够将视频上传到Instagram。

I want my app to be able to upload videos to instagram.

Instagram IPhone Hooks 提供了如何使用iphone挂钩将照片上传到instagram的信息。我的问题是,如果有人对如何完成相同但是对于视频有任何经验吗?

Instagram IPhone Hooks gives information how to use the iphone hooks to upload a photo to instagram. My question is if anyone has any experience on how to accomplish the same but for a video?

推荐答案

Instagram的API不直接支持从第三方应用程序上传任何内容因此,在向用户提供功能时,您必须做出一些丑陋的用户体验妥协。

Instagram's API doesn't directly support uploading anything from 3rd party applications. Therefore you have to do some ugly user experience compromises when providing the functionality to your users.

首先,准备要上传到Instagram的视频并存储其路径某处

First, Prepare the video you want to upload to Instagram and store the path to it somewhere

其次,将其保存到用户的相机胶卷:

Second, Save it to the user's Camera Roll:

if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(filePath)) {
    UISaveVideoAtPathToSavedPhotosAlbum(filePath, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
}

第三,既然视频已保存,请告诉用户为了将视频上传到他们的Instagram,他们必须在点击上传按钮后从他们的相机胶卷中选择它。

Third, now that the video is saved, tell the user that in order to upload the video to their Instagram, they must select it from their camera roll after clicking the upload button.

上传按钮只会执行以下操作:

The upload button would simply do the following:

NSURL *instagramURL = [NSURL URLWithString:@"instagram://camera"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
    [[UIApplication sharedApplication] openURL:instagramURL];
}

Instagram API不支持通过任何媒体立即选择媒体,这非常愚蠢API端点用于上传目的,但就目前而言,这是唯一的方法。

It's very silly that the Instagram API doesn't support immediate media selection through any of the API endpoints for upload purposes, but as it stands right now, this is the only way.

这篇关于使用挂钩在Instagram上发布视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆