I was trying to do the project where u user types a username in a search field and it gets the user profile with the number of likes per post and comments. The app is in React and NextJS. To do that I upgraded my Instagram account first to creator then to business professional, next I created an app in https://developers.facebook.com/, and in the allowed domains and redirect I entered my website and localhost. This is the Login function
FB.login(
(response) => {
if (response.authResponse) {
console.log("Welcome! Fetching your information.... ");
const token = response.authResponse.accessToken;
setAccessToken(token);
const userId = response.authResponse.userID;
} else {
console.log(
"User canceled login or did not fully authorize."
);
}
},
{ scope: "email,public_profile" }
);
And here is my first question, does a user have to do that? Can't I connect my account to do this search, I have tried to implement this function in useEffect found in the docs that the browser would block it if this is not in the handler.
As you can see I query for the scope email and public profile here, to query for media or comments in graph Api I need permissions for instagram_basic, pages_read_engagement and pages_show_list but when I set the scope to these, on Click the popup opens with the message "Sorry something went wrong..." and I don't know if this is the matter of permissions or something else. And in the docs they say
Apps may ask for the following two permissions from any person without submitting for review by Facebook:
public profile email
Is it possible to get the number of likes and comments without submitting the app for review? What do I need to do to be able to request instagram basic and pages show list credentials?
Thanks