分享 Instagram 的官方文档链接点 这里。
分享 Instagram 不需要添加任何的 SDK 。
一、Custom URL Scheme
Instagram 有自定义分享接口,可以直接跳进 Instagram 内,进入各个页面的参数分别为:
URL
OPENS
app
The Instagram app
camera
The camera (or photo library on non-camera devices)
media?id=MEDIA_ID
Media with this ID
user?username=USERNAME
User with this username
location?id=LOCATION_ID
Location feed for this location ID
tag?name=TAG
Tag feed for this tag
将下面的代码添加到你的分享方法中:
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
}
是不是发现还不能顺利跳进 Instagram,并且打印如下信息: