insgram 网页分享_iOS - 实现Instagram分享

本文介绍了在iOS应用中实现不使用SDK直接调用Instagram的自定义URL Scheme进行分享的方法,包括如何跳转到Instagram应用、相册以及解决权限问题。同时提供了通过Document Interaction分享到Instagram的方案。
摘要由CSDN通过智能技术生成

分享 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,并且打印如下信息:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值