Instagram API会在成功登录时阻止重定向到iOS应用程序,并出现400错误请求错误 [英] Instagram API prevents redirection to iOS app upon successful login with 400 bad request error

查看:821
本文介绍了Instagram API会在成功登录时阻止重定向到iOS应用程序,并出现400错误请求错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

如何在用Instagram登录后将用户重定向到应用程序。

I'm trying to integrate Instagram login into my app to get the logged in user's details, I've registered my app on Instagram and got my client ID, then I added a new URL Type in the project settings with the identifier: igxxxx (where xxxx is my client id), i've also set the redirect URI to be (xxxx://authorize), once I successfully log in (using a webView) Instagram displays a white blank page with (400 Bad Request) text written on top, however, when I change the redirect URI to anything else, it opens without problems after a successful login.
how can I redirect the user to the app after he logs in with Instagram.

ps我使用这个库来简化事情。

p.s. I use this library to ease up things.

提前感谢。

推荐答案

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

Here's what I have found so far. I have been able to resolve the issue to get the app to work on the iPhone. However, this solution doesn't allow me to submit the app on the app store as you will read ahead. I have submitted a bug with instagram, not sure how long they will take.

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

I would suggest everyone go to this link and "Report Issue":

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

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

I have had an app in app store for couple months without problems. However, since June 19, all the users trying to authenticate get a white page with "400 Bad Request" after they login with their IG account.

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

The issue is very common as you will see on this stack overflow page:

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

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

And google shows the same issue with many users since June 19.

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

I have figured out that the old redirect URI which we were using:

myappname://

是问题。

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

If we change this redirect URI to:

http://myappname

https://myappname

这一切都开始正常工作,我们得到了acc ess令牌。

This all starts working fine and we get the access token.

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

However as per RFC1738, this is not a valid format for URL schemes which is used in iOS development.

因此,我们在向应用商店提交应用时遇到错误:

So we get error when submitting our apps to app store:

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."

因此我们无法向app store提交这个解决方案。

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

So unless instagram does something to fix this back to how it used to be, we are stuck :(

这篇关于Instagram API会在成功登录时阻止重定向到iOS应用程序,并出现400错误请求错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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