<分区>
是否有任何公共(public) API 可以在 Instagram 上发布视频?
我们知道在 iOS 上可以使用 iPhone Hooks 共享图像(JPEG 或 PNG)通过 iOS 文档交互。
在 Android 上,可以通过 Android Intent 分享视频.
iOS 应用 Cinamatic在 oAuth API 之后执行此操作,但根据 Instagram API documentation没有提到“视频”类型的媒体对象。
我们还知道其他不使用 Instagram oAuth 的应用程序会将视频保存在视频文件夹中,然后通过提到的 iPhone Hooks 打开 Instagram 相机,以便让用户打开该视频,但是它不是那么聪明。
那么 Cinamatic 是如何使用 API 做到这一点的呢?
未记录的 Instagram Video Hook 让您可以像 Camera Hook 一样将视频分享到 Instagram
URL: instagram://library
Path parameter: AssetPath
Comment parameter: InstagramCaption
所以你有类似的东西
NSString *instagramURL = [NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@",videoURL,[videocaption stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
}