Instagram API阻止在成功登录时重定向到iOS应用程序400错误请求错误

时间:2016-06-18 14:26:14

标签: ios iphone instagram

我正在尝试将Instagram登录集成到我的应用程序中以获取登录用户的详细信息,我已经在Instagram上注册了我的应用程序并获得了我的客户端ID,然后我在项目设置中添加了一个带有标识符的新URL类型:igxxxx(其中xxxx是我的客户端ID),我还将重定向URI设置为(xxxx://authorize),一旦我成功登录(使用webView),Instagram显示一个白色空白页面(400 Bad Request)文本写在顶部,但是,当我将重定向URI更改为其他任何内容时,它会在成功登录后立即打开。
如何在用Instagram登录后将用户重定向到应用程序。

P.S。我使用this library来缓解事情。

提前感谢。

1 个答案:

答案 0 :(得分:2)

这是我迄今为止所发现的。我已经能够解决问题,让应用程序在iPhone上运行。但是,此解决方案不允许我在应用商店中提交应用,因为您将提前阅读。我已经提交了一个关于instagram的错误,不知道他们会花多长时间。

我建议大家都去看这个链接"报告问题":

https://www.instagram.com/developer/clients/manage/

我在应用程序商店中有一个应用程序几个月没有问题。 但是,自6月19日以来,所有尝试进行身份验证的用户都会获得一个白页,其中包含" 400 Bad Request"用他们的IG帐户登录后。

这个问题非常常见,您将在此堆栈溢出页面上看到:

Instagram API prevents redirection to iOS app upon successful login with 400 bad request error

自6月19日以来,谷歌向许多用户展示了同样的问题。

我已经知道我们使用的旧重定向URI:

myappname://

是问题。

如果我们将此重定向URI更改为:

http://myappname

https://myappname

这一切都开始正常工作,我们获得了访问令牌。

但是根据RFC1738,这不是iOS开发中使用的URL方案的有效格式。

因此,在向应用商店提交应用时会出现错误:

ERROR ITMS-90158: "The following URL schemes found in your app are not in the correct format: [https: //myappname]. URL schemes need to begin with an alphabetic character, and be comprised of alphanumeric characters, the period, the hyphen or the plus sign only. Please see RFC1738 for more detail."
ERROR ITMS-90158: "The following URL schemes found in your app are not in the correct format: [https: //myappname]. URL schemes need to begin with an alphabetic character, and be comprised of alphanumeric characters, the period, the hyphen or the plus sign only. Please see RFC1738 for more detail."

因此我们无法使用此解决方案提交到应用商店。

因此,除非Instagram做了某些事情来解决这个问题,否则我们会陷入困境:(