0

I am really lost here, I have an Expo React-Native application. the user can login with Facebook credentials.

  loginWithFacebook = async () => {
    const { type, token } = await Expo.Facebook.logInWithReadPermissionsAsync(FACBOOK_APP_ID, {
      permissions: ['public_profile', 'email'],
    });

    if (type === 'success') {
      this.callGraph(token);
    } else {...});
    }
  };

and

callGraph = async (token) => {
    const response = await fetch(`https://graph.facebook.com/me?access_token=${token}&fields=id,name,email,picture`);
    const responceJSON = JSON.stringify(await response.json());
    try {
      await AsyncStorage.multiSet([['FBResponse', responceJSON], ['FBToken', token]]);
    } catch (error) {...}
  };

now I have the Token and info of the loged in user. now I get a picture from cameraRoll

  pickImage = async () => {
    const result = await Expo.ImagePicker.launchImageLibraryAsync({...});
  };

which gives the URI of the image at the device, also I am using RNFetchBlob to again have the image as base64. but I am really confused that how should I share/upload this picture to Facebook. Should I eject from Expo install FBSDK and do it from Android folder? or I can do it with the Graph API? or I can Link it to Expo? I could not find a single example, just simple react-native-share samples are what I see everywhere.

Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123

1 Answers1

0

Facebook integration for Expo only accepts read permissions and one cannot login with publish_actions it seems the community is still working on it. and for using fbsdk you should either eject from Expo or ask for permissions via the Expo WebBrowser integration.

Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123