Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Setup : if using ReactNative less than 0.60

fan-w-suzuki edited this page Nov 6, 2019 · 1 revision

Requirement

  • Android Studio: 3.3
  • Xcode: 10.2.1
  • react: 16.8.3
  • react-native: 0.59.8
  • react-native-cli: 2.0.1

Installation

  1. cd path/to/your/react-native-project
  2. npm i react-native-nend-bridger
  3. react-native link react-native-nend-bridger

Android

  1. Add maven url 'http://fan-adn.github.io/nendSDK-Android-lib/library' to your project-level build.gradle.
    allprojects {
        repositories {
            mavenLocal()
            google()
            jcenter()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            maven {
                // nendSDK
                url 'http://fan-adn.github.io/nendSDK-Android-lib/library'
            }
        }
    }
  2. Add NendAdPackage into your ReactPackage List. It's already defined maybe into MainApplication class extends Application, implements ReactApplication that is created when react-native init YOUR_PROJECT.
    e.g. ↓↓↓
    public class MainApplication extends Application implements ReactApplication {
            ・・・・・
            @Override
            protected List<ReactPackage> getPackages() {
                return Arrays.asList(
                        new MainReactPackage(),
                        new NendAdPackage() // <- It's necessary to using our nend-bridgings
                );
            }

iOS

  1. cd path/to/your/react-native-project/ios
  2. Add pod 'NendSDK_iOS' to your Podfile
  3. pod install --repo-update
  4. Open YOUR_PROJECT.xcworkspace
  5. Add new Swift file into your main build target for auto creation Swift-Bridging-Header and Objective-C generated interface Header img
    img
Clone this wiki locally