I followed the example in the readme (tried both manual installation and automatic) and no matter what I do, when I press the share button Share.open always fails with:
undefined is not an object (evaluating '_reactNativeShare2.default.open')
building on Ubuntu 14.04 64-bit and running on Android 5.0.1
Yes, rnpm link doesn’t work. In React Native >= 0.29 you need:
Android
npm install react-native-share --save
Open up
android/app/src/main/java/[...]/MainApplication.java
import cl.json.RNSharePackage;
to the imports at the top of the filenew RNSharePackage()
to the list returned by thegetPackages()
methodAppend the following lines to
android/settings.gradle
:include ':react-native-share' project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
Insert the following lines inside the dependencies block in
android/app/build.gradle
: