Instagram视频iPhone Hook [英] Instagram Video iPhone Hook

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

问题描述

目前最佳解决方案:

https://stackoverflow.com / a / 21888830/1786820

我正在尝试做一个更好的方法,打开带有PhotoRoll预选视频文件的Instagram应用程序,以及预装标题。在Flipagram应用程序中,他们就是这样做的。当您点击视频分享时,他们会保存您的相机胶卷,建议一个标题,然后直接进入Instagram应用照片选择屏幕,并预先选择视频。即使视频不是PhotoRoll中的最新媒体,它也会正确地突出显示正确的视频,以及Flipagram应用程序中准备的标题。

I am trying to do one better, by opening the Instagram app with a preselected video file from the PhotoRoll, and a preloaded caption. In the Flipagram app, they do just this. When you hit share on a video, they save it your camera roll, suggest a caption, then direct to the Instagram app photo selection screen, with the video preselected. Even if the video is not the latest media in the PhotoRoll, it correctly highlights the correct video, along the caption prepared in the Flipagram app.

这可能是一个未记录的iPhone钩子吗?

Is this possibly an undocumented iPhone hook?

任何帮助表示赞赏。

推荐答案

我想出了允许我的应用程序接受instagram:// URL架构的想法。来自Flipagram的钩子在我的应用程序中打开如下:

I came up with the idea to allow my app to accept the instagram:// URL schema. The hook from Flipagram opened up in my app as the following:

instagram:// library?AssetPath = assets-library%3A%2F%2Fasset%2Fasset.mp4% 3Fid%3D8864C466-A45C-4C48-B76F-E3C421711E9D%26ext%3Dmp4& InstagramCaption =一些%20Preloaded%20Caption

instagram://library?AssetPath=assets-library%3A%2F%2Fasset%2Fasset.mp4%3Fid%3D8864C466-A45C-4C48-B76F-E3C421711E9D%26ext%3Dmp4&InstagramCaption=Some%20Preloaded%20Caption

未记录的iPhone挂钩,允许您自动选择资产iPhone照片滚动,并为视频预加载标题。这应该为您提供Flipagrams应用程序与Instagram共享视频时的相同用户体验。

The undocumented iPhone hook that allows you to automatically select assets from the iPhones photo roll, and preload a caption for the video. This should give you the same user experience that Flipagrams app has with sharing a video to Instagram.

NSURL *videoFilePath = ...; // Your local path to the video
NSString *caption = @"Some Preloaded Caption";
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:videoFilePath] completionBlock:^(NSURL *assetURL, NSError *error) {
    NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@",[assetURL absoluteString].percentEscape,caption.percentEscape]];
    if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
        [[UIApplication sharedApplication] openURL:instagramURL];
    }
}];

效果很好!

更新:
Instagram已删除将标题传递给其应用的功能。现在最好的解决方案就是将所需的标题复制到粘贴板上。

Update: Instagram has removed the ability to pass the caption to their app. The best solution now it to just copy the desired caption to the paste board.

这篇关于Instagram视频iPhone Hook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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