onLoginFailure being triggered every time
The login was working fine but after adding another Instagram tester user the "onLoginFailure" keeps triggering instead of "onLoginSuccess".
I get this as well, it also gives a code in error response object, insead of token and HTML page is logged out into console.
i am also facing that issue. Instagram Login was working yesterday also. Now its throwing some 403 forbidden issue for android only
Also facing the problem, Android only
I have also the same problem, both on real android device and ios device. Somehow the login is working correctly on ios simulator ... Which is rather strange, the code executed being exactly the same.
The first code is correctly retrieved but it's the request to https://api.instagram.com/oauth/access_token which gets a 403 response (but not on ios simulator)
Found the issue but this is rather unexplainable ...
Instagram changed the fields app_id and app_secret used with access_token to client_id and client_secret. https://developers.facebook.com/docs/instagram-basic-display-api/reference/oauth-access-token
So in the file instagram.js from your react-native-instagram-login replace the following code
form.append('app_id', appId);
form.append('app_secret', appSecret);
form.append('grant_type', 'authorization_code');
form.append('redirect_uri', redirectUrl);
form.append('code', code);
with
form.append('client_id', appId);
form.append('client_secret', appSecret);
form.append('grant_type', 'authorization_code');
form.append('redirect_uri', redirectUrl);
form.append('code', code)
And your login should work again.
Why the requests are working on the ios simulator and failing with a real device is totally beyond me though ...
athorisation on instagram is returning code key instead of acess token key, as mentioned above you can make changes in libraray's main file accordingly. here it is: https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
i forked and fixed the issue. Here is my package: "react-native-instagram-login": "git+https://github.com/bidchatindia/react-native-instagram-login.git#v2" You can use my package till they give update to this package.
why not to copy lib code locally and change untill lib not updated.
@Rramandeep Our app is already live on store. You will have to give new update to playstore for that anyways. i made codepush to my users and done!
@Dhanraj-bidchat no offence bro, but my app is under developement that's why.
@Rramandeep thats fine bro. Nobody is forced to use my package. Its for beginners who may find it difficult to do so.
I updated the library, so you can remove the old version and install the new version. Feel free to comment here. Love guys.
Found the issue but this is rather unexplainable ...
Instagram changed the fields app_id and app_secret used with access_token to client_id and client_secret. https://developers.facebook.com/docs/instagram-basic-display-api/reference/oauth-access-token
So in the file instagram.js from your react-native-instagram-login replace the following code
form.append('app_id', appId); form.append('app_secret', appSecret); form.append('grant_type', 'authorization_code'); form.append('redirect_uri', redirectUrl); form.append('code', code);with
form.append('client_id', appId); form.append('client_secret', appSecret); form.append('grant_type', 'authorization_code'); form.append('redirect_uri', redirectUrl); form.append('code', code)And your login should work again.
Why the requests are working on the ios simulator and failing with a real device is totally beyond me though ...
You also change the appId to client_id
let ig_uri = `https://api.instagram.com/oauth/authorize/?client_id=${appId}&redirect_uri=${redirectUrl}&response_type=${responseType}&scope=${scopes.join(',')}`;
@kiritm-nimblechapps I forgot it. Thank u. i updated.
Getting this on the "onLoginFailure"
Object { _: "" }
The latest package was working a while ago.
@tuladharjaa can you give me steps to get onLoginFailure? or send me a video about this
The screen capture is on the following link: https://drive.google.com/file/d/17zwnpqwRmwP11FqCm6DdBk9p-8sqA_5a/view?usp=sharing
The code I have used: <Instagram ref={instagram => { this.instagramLogin = instagram; }} appId={config.igAppId} appSecret={config.igAppSecret} redirectUrl={config.igRedirectUrl} scopes={['user_profile', 'user_media']} onLoginSuccess={this.setIgToken} onLoginFailure={(data) => console.warn("Failure", data)} onClose={() => this.props.navigation.goBack(null)} />
Tried to see if I had a login problem again on my app but it's working on iOS both device and simulator for me right now.
@tuladharjaa can you step into the library with the debugger and see what are the result of the instagram requests ? Does anyone else also have a login problem again ?
The returned URL from WebView does not contain the codes. It just returns the redirectURL
I am getting this on an Android device.
@tuladharjaa you tried android login with same user that you loged in on iOS?? If your app is not live, always add new user as test user if not done
@tuladharjaa you tried android login with same user that you loged in on iOS?? If your app is not live, always add new user as test user if not done
I have added the account as tester and was working previously on Android. I have not tried it on iOS.
@tuladharjaa can you try one common test account on both and let us know please?
@tuladharjaa can you try one common test account on both and let us know please?
On iOS it is working fine.
Just tried with an android emulator and it's working fine on my end. I'll test later with a real android device and let you know if I can also reproduce the login pb.
I just checked it again, it still works normally. I don't know the exact error.
I installed the version 2.0.2 and then made changes on the Instagram.js file and it is working fine.
Hey guys! Thanks for your efforts.. but, I'm receiving on onLoginFailure an object with the code. Anyone can help me?
@denisprado show me your error, your code and your current version you are using
@hungdev HI. My component is like that:
<InstagramLogin ref={ref => (instagramLogin = ref)} appId={igProd.appId} responseType="code" appSecret={igProd.appSecret} scopes={['user_profile', 'user_media']} redirectUrl={igProd.redirectUrl} onLoginSuccess={setIgToken} onLoginFailure={data =>console.log(data.code)} />
and I'm using the last version, 2.0.4. The error is the onLoginSuccess not receiving any data. I'm receiving a code onLoginFailure.
@denisprado show me error from onLoginFailure func