Avinash A
Avinash A

Reputation: 793

TypeError: Cannot read property 'FACEBOOK' of undefined in expo React native for Android

I am creating an Image share option in expo(only for android in react native) using the react-native-share library, but i am getting the following error TypeError: Cannot read property 'FACEBOOK' of undefined

My React Native code

import Share from 'react-native-share';

const baseImage = "data:image/png;base64,iVBORw0KGgoAA ......"; // base64image

const myCustomShare = async()=> {
  const shareOptions = {
      url: baseImage
  };
  try {
      const shareResponse = await Share.open(shareOptions)
  } catch(error) {
      console.log(error)
  }
}

I have already tried the following steps to resolve this issue but still i am getting the same error

  1. npm install react-native-share
  2. react-native link react-native-share

Upvotes: 4

Views: 2818

Answers (1)

Helder Correia
Helder Correia

Reputation: 1

I believe there's some issue integrating the module correctly in your project. Please following the next steps:

step 01: yarn add react-native-share or npm install react-native-share

step 02: npx pod-install or cd ios && pod install. (You can skip this step, if you are using this on Android).

Upvotes: 0

Related Questions