Manual installation
iOS#
- In XCode, in the project navigator, right click
LibrariesโAdd Files to [your project's name] - Go to
node_modulesโreact-native-iapand addRNIap.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNIap.ato your project'sBuild PhasesโLink Binary With Libraries - Run your project (
Cmd+R)<
iOS with Podfile#
- Open up
ios/Podfile
- Add
pod 'RNIap', :path => '../node_modules/react-native-iap'
- Run
pod install
Android#
- Open up
android/app/src/main/java/[...]/MainApplication.java- Add
import com.dooboolab.RNIap.RNIapPackage;to the imports at the top of the file - Add
new RNIapPackage()to the list returned by thegetPackages()method
- Add
- Append the following lines to
android/settings.gradle: - Insert the following lines inside the dependencies block in
android/app/build.gradle: - Update ProGuard config (Optional)
- Append the following lines to your ProGuard config (
proguard-rules.pro)
- Add the following to the
<permission>block inandroid/app/src/main/AndroidManifest.xml: