Nami ML

Nami ML Documentation

Welcome to the Nami ML documentation hub. You'll find comprehensive guides and documentation to help you start working with Nami ML as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Add the SDK

The first step in getting up and running with Nami in your App is to add it to your project. In this guide you'll find instructions for adding the Nami SDK to your project in

Apple

We support several options to get your project up and running with Nami in the Apple ecosystem. Also, check out our Github Repository.

📘

Apple Requirements

The Nami Apple SDK supports

  • iOS 11+
  • iPadOS 13+

The framework is built for Xcode 11.

CocoaPods

Add the following line to your Podfile. We have an example Podfile in our repository if you do not currently have one.

🚧

Must be using CocoaPods 1.9.1+

The Nami SDK on Apple is distributed as an XCFramework and only works with CocoaPods 1.9.1 and higher.

pod "Nami", "2.5.2"

Then run the following command in your Terminal.

$ pod install

❗️

CocoaPods could not find compatible versions for pod "Nami"

If you receive this or a similar error, try running the command
pod update and then re-running pod install.

Manual Setup

  1. Start by downloading the Nami framework from GitHub.
  2. Copy Nami.xcframework to your local project directory.
  3. Navigate to your application's Project settings page in Xcode select the General tab, and then scroll down until you find the Frameworks, Libraries, and Embedded Content section.
  1. Drag and drop the Nami.xcframework from the finder into the Frameworks, Libraries, and Embedded Content section.
  1. When this step is complete, your Xcode should look like this:

Now you are all set to start building for both the simulator and your devices with the Nami SDK in Xcode 11.

Android

📘

Android Requirements

  • Android SDK minimum version 21
  • SDK builds target Android 11 (API version 30)
  • SDK has been built with Java v8 and Kotlin v1.4.10

Our Android SDK is available via our Maven repository. Add the following code snippet to your project's build.gradle to add the Nami SDK to your project.

repositories {
  maven { url "https://nami-android.s3.amazonaws.com/" }
}

Then in the build.gradle for your app add the following code, replacing the version number with whichever version of the Nami SDK you would like to run.

dependencies {
  implementation "com.namiml:sdk-android:0.5.0" 
}

Add compileOptions for Java 8 compatibility in build.gradle

android {
  ...
  // Configure only for each module that uses Java 8
  // language features (either in its source code or
  // through dependencies).
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
  // For Kotlin projects
  kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8.toString()
  }
}

React Native

The Nami SDK can be accessed from React Native via an NPM bridge module, that will link in the full native SDK and allow access to various Nami capabilities. The React Native bridge currently supports both Android and iOS. The code for the React Native bridge is also available on our Github.

🚧

This section includes platform-specific instructions for Apple and Android that may differ from the general Apple and Android instructions for adding the SDK.

📘

React Native for iOS Requirements

The React Native bridge for iOS requires

  • CocoaPods 1.9.1+
  • React 16.8.0+
  • React Native 0.61.0+

If you need help setting up your React Native development environment, you can find instructions here:
https://reactnative.dev/docs/environment-setup
.

To add Nami to your React Native project, start by adding the React Native bridge to your project with yarn or npm.

yarn add react-native-nami-sdk
npm install react-native-nami-sdk --save

React Native - Android

Modify your build.gradle file to work with Nami ML.

  1. Edit the build.gradle file in your project, found at android/build.gradle.
  2. Add classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0" to the buildscript > depedencies.
  3. Set the minSdkVersion = 21 in buildscript > ext.
  4. Add the Nami ML maven repository with this code maven { url("https://nami-android.s3.amazonaws.com/") } to your project under allprojects > repositories.

For a brand new React Native project, your build.gradle file should look like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
  ext {
    buildToolsVersion = "29.0.2"
    minSdkVersion = 21
    compileSdkVersion = 29
    targetSdkVersion = 29
  }
  repositories {
    google()
    jcenter()
  }
  dependencies {
    classpath("com.android.tools.build:gradle:3.5.3")
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0"
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }
}

allprojects {
  repositories {
    mavenLocal()
    maven {
      // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
      url("$rootDir/../node_modules/react-native/android")
    }
    maven {
      // Android JSC is installed from npm
      url("$rootDir/../node_modules/jsc-android/dist")
    }

    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
    maven { url("https://nami-android.s3.amazonaws.com/") }
  }
}

Build and run your Android app.

  1. Open the project or build.gradle for your app in Android Studio.
  2. Allow the gradle sync process to complete.
  3. Return to the command line and run the following command:
yarn run android

React Native - Apple

After running the yarn install command above, take the following steps to build your app with Nami for Apple devices.

  1. Confirm that the minimum version of your iOS project is at least 11.0. You can find this in your Podfile located at ios/Podfile. For a brand new React Native project, the first few lines of your Podfile should look like the example below:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
  1. cd ios && pod update
  2. You can either run yarn run ios or open your xcworkspace file and build the app in Xcode.

Updated about 16 hours ago



Add the SDK


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.