react-native-airbridge
Getting started
$ npm install react-native-airbridge --save
Make sure 'AirBridge' is in your ios/Podfile like below
target 'MyTestApp' do
pod 'AirBridge'
end
Pod install
$ cd ios/
$ pod install
Automatic installation
$ react-native link react-native-airbridge
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-airbridge
and addRNAirBridge.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNAirBridge.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNAirBridgePackage;
to the imports at the top of the file - Add
new RNAirBridgePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-airbridge' project(':react-native-airbridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-airbridge/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-airbridge')
Supported Events
- Signup
- Signin
- Home Screen View
- Product List
- Search Result View
- Product View
- Add To Cart
- Purchasing
- Signout
Usage
; // Your productsconst products = productId: 'prd-1' name: 'product-name1' price: 3000 quantity: 1 currency: 'KRW' orderPosition: 1 productId: 'prd-2' name: 'product-name2' price: 2000 quantity: 3 currency: 'KRW' orderPosition: 2; // InitializeAirBridge; // SigninAirBridge; // SignupAirBruserIe; // Home Screen ViewAirBridge; // Product ListAirBridge; // Product ViewAirBridge; // Search Result ViewAirBridge; // Search Result ViewAirBridge; // PurchasingAirBridge; // Custom EventAirBridge;