Thursday, June 6, 2024
HomeiOS Developmentreact-native the best way to login to instagram IOS?

react-native the best way to login to instagram IOS?


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:
enter image description here
enter image description here

The issues are:

  1. The permissions which I am retrieving in console.log(information.getPermissions()) are completely different from requested – why instagram_basic not added though requested

  2. My entry token not accepted to get even public info like identify & id

  3. What provides me LimitedAccess and what I ought to de with it

  4. Do I really want to attach from Fb to get entry to Instagram Graph API.

  5. The workflow of the best way to get the variety of Instagram followers not clear.

  6. All examples which I am discovering on stack overflow or over web nearly not working in 2024.

Right here is program log output:
enter image description here

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.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments