@npm_fluentco/adflow-react-native-sdk
v1.0.12
Published
Fluent Ad Flow Widget
Downloads
434
Readme
@npm_fluentco/adflow-react-native-sdk
Fluent AdFlow Widget SDK for React Native
Installation
npm install @npm_fluentco/adflow-react-native-sdk
Usage
import {
FluentAdFlowWidgetView,
FluentAdFlowWidget,
} from '@npm_fluentco/adflow-react-native-sdk';
// ...
FluentAdFlowWidget.init('<your-api-key>', '<referer>');
// ...
const optionalEvent = (isAdShown) => {
// Your logic here
};
<FluentAdFlowWidgetView
params={params}
style={styles.wrapper}
onAdShow={optionalEvent}
/>;
Integrating into Applications
Follow instructions in Installation and Usage.
Configure the SDK for iOS
The iOS SDK requires version 13 or greater. Please ensure the iOS version in your applications' Podfile
(usually located at the top-level of the ios directory in your react-native application) is set to 13.0 or greater. For example, you may need to change:
platform :ios, min_ios_version_supported
To
platform :ios, '13.0' // or version of your choice >= 13.0
After installing the npm package, you will need to install the iOS dependencies.
cd ios && pod install
NOTE: For Mac M1 architecture issues, use:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
Configure the SDK for Android
To use the SDK in your Android application you will need to insert or update the following information in your application’s build.gradle
:
MultiDexEnabled and minSdkVersion are required configuration values.
allprojects {
repositories {
mavenCentral()
google()
maven {
url = uri("https://mobile-sdk.adflow-prod.minionplatform.com/android")
}
}
}
android {
...
defaultConfig {
...
multiDexEnabled true,
minSdkVersion 24
}
...
dependencies {
...
implementation("com.fluent.adflowsdk:adflow:1.0.22")
...
}
}
NOTE: For Kotlin version conflicts during the build, refer to recommended solutions.
Update your ReactApplication (typically located in the MainApplication.java
class file) with the following. This will add the SDK to the Android project within your react-native application.
import com.fluentadflowreactnativesdk.FluentAdFlowWidgetPackage;
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new FluentAdFlowWidgetPackage());
return packages;
}
License
© 2023 Fluent, LLC Licensed under the Fluent Software Development Kit (SDK) Terms of Use, Ver. 1.0 (the "Agreement"). Your use of this SDK is subject to the Agreement which you can access here