1

我正在使用 react-native-instagram-login 在 react native 中进行 instagram 集成。我已经尝试过,但是当我登录 instagram 时,它给了我这个错误

{"error_type": "OAuthException", "code": 400, "error_message": "Invalid redirect_uri"}

这是我的代码

<TouchableOpacity onPress={() => this.instagramLogin.show()}>
   <Text style={{color: 'black', textAlign: 'center'}}>Login now</Text>
</TouchableOpacity>
<InstagramLogin
   ref={(ref) => (this.instagramLogin = ref)}
   appId="*******"
   appSecret="**********"
   redirectUrl="https://www.google.com"
   scopes={['user_profile', 'user_media']}
   onLoginSuccess={(data) => console.log('check data ', data)}
   onLoginFailure={(data) => console.log(data)}
/>

在开发者 facebook 中,我放置了 Valid OAuth Redirect URIs - https://www.google.com

4

1 回答 1

0

这很简单,您必须在重定向网址上添加斜杠。

 <TouchableOpacity onPress={() => this.instagramLogin.show()}>
          <Text style={{color: 'black', textAlign: 'center'}}>Login now</Text>
        </TouchableOpacity>
        <InstagramLogin
          ref={(ref) => (this.instagramLogin = ref)}
          appId="*******"
          appSecret="**********"
          redirectUrl="https://www.google.com/"
          scopes={['user_profile', 'user_media']}
          onLoginSuccess={(data) => console.log('check data ', data)}
          onLoginFailure={(data) => console.log(data)}
        />

于 2020-12-17T06:33:04.080 回答