我正在使用react-native-instagram-loginReact Native。
这是我的代码
<InstagramLogin
ref={instagramLoginRef}
appId='***********'
appSecret='*******************'
scopes={['user_profile', 'user_media']}
onLoginSuccess={(data) => console.log("Success")}
onLoginFailure={(data) => console.log("Fail " + JSON.stringify(data))}
/>
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Run Code Online (Sandbox Code Playgroud){"error_type": "OAuthException", "code": 400, "error_message": "Invalid redirect_uri"}
在 Instagram 开发者控制台中,我应该添加什么作为重定向 Uri,因为这不是网站,而是本机应用程序。
我有一个奇怪的问题,当 TextInput 放置在子功能组件中时,键盘在打字时一直关闭。如果 TextInput 直接放在父组件下,则不存在此问题。这是我的代码
const SignInScreenC = props => {
// define Hook states here
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [isEmailEmpty,setIsEmailEmpty] = useState(false);
const [isEmailValid,setIsEmailValid] = useState(true);
const [isPasswordEmpty,setIsPasswordEmpty] = useState(false);
/**
* Called when Sign in is clicked.
* checks if the form is valid
*/
const _OnSignInClicked = () => {
if(_isFormValid()) {
//make api call
}
}
/* Checks if the form is valid
*/
const _isFormValid = () => …Run Code Online (Sandbox Code Playgroud)