Linking WebEngage React Native library manually

Android

  1. Include the WebEngage React Native directory in your Android project. To do this, add the below snippet in android/settings.gradle file.
include ':react-native-webengage'
project(':react-native-webengage').projectDir = new File(settingsDir, '../node_modules/react-native-webengage/android')
  1. Add React Native dependency in android/app/build.gradle file.
dependencies {
	...
	compile project(':react-native-webengage')
}
  1. Create a new object of WebEngage package in android/app/src/main/java/[your/package]/MainApplication.java file.
import com.webengage.WebengagePackage;

...
...

@Override
protected List<ReactPackage> getPackages() {
	return Arrays.<ReactPackage>asList(
		... ,
		new WebengagePackage()
	);
}

iOS

Open your iOS folder in Xcode.

  1. Drag and drop node_modules/react-native-webengage/ios/RNWebengage.xcodeproj into the Libraries folder of your project in Xcode. Check Step 1 here for detailed instructions.
  2. Drag and drop the libRNWebengage.a product in RNWebengage.xcodeproj into your project's target's Link Binary With Libraries section. Check Step 2 here for detailed instructions.
  3. Under Build Settings, add a Header Search Path pointing to $(SRCROOT)/../node_modules/react-native-webengage/ios. Check Step 3 here for detailed instructions.