@npm_fluentco/adflow-react-native-sdk v1.0.5
@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
file:
allprojects {
repositories {
...
maven {
url = uri("https://mobile-sdk.adflow-prod.minionplatform.com/android")
}
}
}
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;
}
Update multiDexEnabled and SDK version:
android {
...
defaultConfig {
...
multiDexEnabled true,
minSdkVersion 18
}
}
NOTE: For Kotlin version conflicts during the build, refer to recommended solutions.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
Made with create-react-native-library
25 days ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
4 months ago
4 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago