mobile-react-plugin
A React-Native plugin for Taboola SDK
Step 1: Install the dependencies in the local node_modules folder.
$ npm install @taboola/react-native-taboola --save
Step 2: Installing native dependencies
$ react-native link @taboola/react-native-taboola
For Android:
Create empty folder assets
[Your project]/android/app/src/main/ (+ assets)
Add script to package.json:
"android-linux": "react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android
For IOS:
Install CocoaPods
$ gem install cocoapods
To integrate Taboola into your Xcode project using CocoaPods, specify it in your Podfile.
Go to folder [Your project]/ios/
$ cd ios
$ pod init
Open the Podfile and add pod 'TaboolaSDK', '2.1.2'
Run pod install
$ pod install
Step 3: Usage
Import module
import RNTaboolaView from '@taboola/react-native-taboola’;
And use in your app
<RNTaboolaView
mode = "thumbs-feed-01"
publisher = "sdk-tester"
pageType = "article"
pageUrl = "https://blog.taboola.com"
placement = "Feed without video"
targetType = "mix"
scrollEnabled = {true}
interceptScroll = {true}
style={{height:number}}
onOrganicItemClick = { (event) => {
console.warn('onOrganicItemClick ' + event.nativeEvent.itemId);
console.warn('url: ' + event.nativeEvent.clickUrl);
console.warn('name: ' + event.nativeEvent.placementName);
}
}
onAdItemClick = { (event) => {
console.warn('onAdItemClick ' + event.nativeEvent.itemId);
console.warn('url : ' + event.nativeEvent.clickUrl);
console.warn('name : ' + event.nativeEvent.placementName);
}
}
/>
For Testing you can use our Integration Verifier special mode
publisher "sdk-tester"
placement "Feed without video "
PageUrl "https://blog.taboola.com"
PageType "article"
TargetType "mix"
mode "thumbs-feed-01"