@npm_fluentco/adflow-react-native-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@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.10")
        ...
    }
}

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

Package Sidebar

Install

npm i @npm_fluentco/adflow-react-native-sdk

Weekly Downloads

36

Version

1.0.5

License

Copyright 2023 Fluent

Unpacked Size

127 kB

Total Files

35

Last publish

Collaborators

  • fluentco
  • awongfluentco
  • bgidwani-fluentco
  • npm-devops