Swift/Instagram API-如何使用Instagram App进行身份验证 [英] Swift / Instagram API - how to auth with Instagram App

查看:562
本文介绍了Swift/Instagram API-如何使用Instagram App进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个AccessToken,以使该用户已在我的应用程序中授予访问其自己的Instagram帐户的权限.我已经在Instagram开发中心内注册了所有内容.

I need an AccessToken to have the User have granted access to his own Instagram Account within my App. I've registered everything within the Instagram Development Center.

当前,我正在使用 SimpleAuth 来接收Instagram的AccessToken.

Currently I'm using SimpleAuth to receive an AccessToken by Instagram.

到目前为止,一切正常.我正在接收令牌并能够使用它.

So far everything is working well. I'm receiving the Token and am able to use it.

但是,当我第一次登录时,我注意到我不知道密码是什么.我总是使用Facebook登录或已经登录.我不想让我的用户面临同样的问题,并让他们重置其Instagram密码...

But when I wanted to login for the first time, I've noticed, that I had no idea what my password was. I always log in with Facebook or am already logged in. I don't want to have my users face the same issues and have them reset their Instagram password...

我已经在Google上搜索了一段时间,但没有成功. 是否可以通过Instagram应用验证用户身份并接收AccessToken?

I have googled for a while now, without success. Is there a way to authenticate the User and receive an AccessToken using the Instagram App?

我已经在info.plistLSApplicationQueriesSchemes中添加了instagram,并将图像发送到Instagram应用程序以将其发布到那里.因此,调用应用程序本身不是问题.

I already have added instagram to the LSApplicationQueriesSchemes at the info.plist and sending images to the Instagram App to post them there is working. So calling the app itself is not the issue.

这是我当前的代码,可在UIViewController中打开WebView-但用户必须使用用户名和密码登录.

This is my current code that opens a WebView within a UIViewController - but the User has to login with username and password.

更新以下代码: 如何进行身份验证Instagram

我有什么可能?非常感谢您的帮助.

What are my possibilities? Help is very appreciated.

推荐答案

不,您目前无法使用Instagram应用程序对Instagram帐户进行身份验证.

No, you cannot use Instagram app to authenticate Instagram account at the moment.

但是,网络视图似乎是一种合理的登录方式,尤其是在iOS 9及更高版本中,因为它不需要用户在应用程序之间进行切换,也无需点击对话框即可切换应用程序.唯一的麻烦是用户键入用户名和密码,但希望他们只需要这样做一次(除非他们更改帐户).

However, web view seems to be a reasonable way to login especially in iOS 9 and above because it does not require user to switch between apps and having to tap on dialogs to switch app. The only pain is for the user to type username and password, but hopefully they only need to do that once (unless they change account).

Facebook也有类似的问题,并选择使用Web视图登录作为默认的身份验证方式.

Facebook has similar issue and choose to go with web view login as default way to authenticate.

对于未在Safari上登录Facebook的人,他们只需登录一次即可.之后,以后无需进行任何额外的步骤,即可获得所有未来的Facebook登录体验,快速便捷.这意味着随着对这种流程的采用随着时间的推移而增加,人们获得的体验的质量也会随之提高.相比之下,传统的快速应用程序切换流程不会随着时间的推移而改善:对于人们登录的每个新应用程序,附加对话框仍会双向出现.

For the people who are not signed into Facebook on Safari, they will only need to log into Facebook one time. After that, every future Facebook Login experience is fast and convenient with no extra steps. This means that as adoption of this flow increases over time, so does the quality of the experience people get. In contrast, the traditional fast-app-switch flow does not improve over time: The additional dialogs continue to appear in both directions for every new app that people log into.

https://developers.facebook.com/blog/post/2015/10/29/Facebook-Login-iOS9/

这篇关于Swift/Instagram API-如何使用Instagram App进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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