$ npm install react-native-airbridge --save
target 'MyTestApp' do
pod 'AirBridge'
end
$ cd ios/
$ pod install
$ react-native link react-native-airbridge
- 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
)<
- 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')
- Signup
- Signin
- Home Screen View
- Product List
- Search Result View
- Product View
- Add To Cart
- Purchasing
- Signout
import AirBridge from "react-native-airbridge";
// Your products
const 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,
}];
// Initialize
AirBridge.init('your eng app name', 'airbridge token', false);
// Signin
AirBridge.sendSignin('userId', 'userEmail');
// Signup
AirBruserIe.sendSignup('userId', 'userEmail');
// Home Screen View
AirBridge.sendViewHome();
// Product List
AirBridge.sendViewProductList('prd-list-id', products);
// Product View
AirBridge.sendViewProductDetail(products);
// Search Result View
AirBridge.sendViewSearchResult('search query', products);
// Search Result View
AirBridge.sendAddProductToCart('cart_id', products, { totalValue: 3000, currency: 'KRW' });
// Purchasing
AirBridge.sendCompleteOrder(products, {
isInAppPurchase: false,
transactionID: '123456789',
eventValue: 3000,
currency: 'KRW',
});
// Custom Event
AirBridge.sendCustomEvent('category', {
action: 'action',
label: 'label',
value: 3412,
customAttribute: products[0]
});