ios - Instagram API 阻止在成功登录后重定向到 iOS 应用程序并出现 400 错误请求错误

标签 ios iphone instagram

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

附注我用 this library缓解事情。

提前致谢。

最佳答案

这是我目前所发现的。我已经能够解决问题,让应用程序在 iPhone 上运行。但是,此解决方案不允许我在应用程序商店中提交应用程序,您将在前面阅读。我已经用 instagram 提交了一个错误,不确定他们需要多长时间。

我建议大家访问此链接并“报告问题”:

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

我在应用程序商店中有一个应用程序几个月没有出现问题。 但是,自 6 月 19 日起,所有尝试进行身份验证的用户在使用其 IG 帐户登录后都会收到带有“400 Bad Request”的白页。

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

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

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

我发现我们使用的旧重定向 URI:

myappname://

是问题。

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

http://myappname

https://myappname

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

然而,根据 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 采取措施将其恢复到过去的状态,否则我们将陷入困境 :(

关于ios - Instagram API 阻止在成功登录后重定向到 iOS 应用程序并出现 400 错误请求错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37898044/

相关文章:

ios - 将Localizable.strings转换为json

ios - 检查子类是否覆盖了一个方法

ios - 当应用程序未在 ios 7 中运行时如何更新应用程序角标(Badge)编号?

iphone - cocoa touch : NSDateComponents crashes on releasing a fresh instance

ios - 如何使用 AWS Cognito 联合身份登录 Instagram

c# - 在允许更多触摸识别之前等待 TouchesEnded 中的操作完成 - Xamarin iOS

iphone - 如何从 google+ 应用程序启动和共享(如果已安装)

iphone - 如何管理静态、延迟加载的字典和数组的内存负载

c# - 调用 Instagram "Follow peaple"API?

python - 我在将列表作为自动化函数的字符串执行时遇到问题