I am making an attempt to make a easy program to get various instagram followers of a person who present permissions to take action on my app.
For this, as I perceive from Meta documentation, I must login with Fb and get AccessToken. To connect with Fb I discovered react-native-fbsdk-next library which I managed to setup. Subsequent I created a perform for Button onPress as observe:
import { LoginButton, AccessToken, GraphRequest, GraphRequestManager, LoginManager, AuthenticationToken } from 'react-native-fbsdk-next';
const handleFacebookLogin = async () => {
strive{
const consequence = await LoginManager.logInWithPermissions(['public_profile','email','instagram_basic','pages_show_list']);
if(consequence.isCancelled){
console.log('Login Cancelled');
}
else{
const information = await AccessToken.getCurrentAccessToken();
if(!information){
console.log('One thing went flawed acquiring entry token');
}
else {
console.log(information.accessToken.toString())
console.log(information.getPermissions())
const user_public = await axios.get(`https://graph.fb.com/v20.0/me?&access_token=${information.accessToken.toString()}`)
console.log(user_public.information)
}
}
}
catch (error){
console.log("Login fail with error: ", error)
}
}
<Button onPress={handleFacebookLogin} title="Login with Fb"/>
In consequence I am getting a immediate to login:
The issues are:
-
The permissions which I am retrieving in
console.log(information.getPermissions())
are completely different from requested – why instagram_basic not added though requested -
My entry token not accepted to get even public info like identify & id
-
What provides me LimitedAccess and what I ought to de with it
-
Do I really want to attach from Fb to get entry to Instagram Graph API.
-
The workflow of the best way to get the variety of Instagram followers not clear.
-
All examples which I am discovering on stack overflow or over web nearly not working in 2024.
Right here is program log output:
I can’t discover any correct rationalization and/or documentation.
Any ideas could be useful, I am making an attempt to do it already extra then 2 month.
Additionally if anyone can share working instance of the best way to join react-native software to Instagram Graph API to retrieve person info, will assist rather a lot.