登录 Instagram 时出错(禁用 Cookie)-React Native WebView

Error Logging into Instagram ( Disabled Cookies ) - React Native WebView

我的应用程序使用 Instagram OAuth,它从这个 url 打开 Instagram 登录页面:

"https://www.instagram.com/oauth/authorize/client_id=${clientId}&redirect_uri=${redirectUrl}&response_type=${responseType}&scope=${scopes.join('+')}"

用户可以在此处输入用户名和密码,然后按登录按钮。然而,他们第一次进入 Instagram 时会抛出一个错误。 link 第二次打开时,它具有用户数据并将用户导航到应用程序的主屏幕。

错误

This page could not be loaded. If you have cookies disabled in your browser, or you are browsing in private mode, please try enabling cookies or turning off private mode, and then retrying your action.

这里是webView渲染函数;

render() {
    const { uri } = this.state;

    if(this.state.loading){
        return <SpinnerComponent size={'small'}/>;
    }

    return (
        <View style={{ flex: 1 }}>
            <WebView 
                startInLoadingState
                onNavigationStateChange={this.onNavigationStateChange.bind(this)}
                source={{ uri }}
                style={{flex: 1}}
            />
        </View>
    );
}

备注

我正在使用 react-native-cookie 包,当用户退出应用程序时删除属于 Instagram 的 cookie。这很可能是问题所在。但是我不能从我的代码库中删除这个包,因为它是注销过程的必要部分。为了解决这个问题,我在 WebView 的 "componentDidMount" LifeCycle 方法中实现了以下代码,以从站点获取 cookie。但这对我的情况没有帮助。

Cookie.get(https://www.instagram.com);

这里 question 在 Whosebug 上遇到了完全相同的问题。然而,给出的解决方案是在 Obj-C 或 Swift 中,这两者我都不知道。我一直没能找到 React Native 的解决方案。

On webapp authentication...问题与instagram平台有关。我发现只有当您的浏览器没有设置 instagram cookie "ig_cb" 时才会出现问题。 这是在您接受 instagram.com 上的 cookie 政策时设置的。 解决方法是继续访问 instagram 并接受 cookie 政策,然后返回您的社交身份验证并继续。

在 instagram 登录过程中受阻...我想除了等待 instagram 错误修复之外没有确定的解决方案。