This project is a lightweight iOS host application designed to demonstrate the simplest use case of the Nami Pairing SDK.
Internally, this project is used by the Nami team to test local SDK changes without the overhead of the full Lookout24 application. Externally, it serves as a reference implementation for consumer apps integrating the NamiPairingFramework.
- Open the monorepo workspace at
nami.xcworkspace. - Select the
nami companionscheme in Xcode. - Build and run on an iOS Simulator or physical device.
Note: The demo app links against the local NamiPairingFramework. If you are testing local framework changes, ensure the XCFramework is compiled and correctly embedded in the target's "Frameworks, Libraries, and Embedded Content" phase.
The following steps illustrate how a third-party application integrates the Nami Pairing SDK, as demonstrated in this project.
Add the SDK via Swift Package Manager (SPM) using the distribution repository:
- URL:
https://github.com/namiai/NamiPairing_iOS.git - Version:
v4.0.1and above
In the file where you plan to initialize and present the SDK, import the required modules:
import NamiPairingFrameworkThe SDK requires the API base URL, a token store carrying the session tokens, and a secure storage provider for Thread datasets.
Important: The SDK instance should be created once and reused throughout the app's lifetime. The same instance can be used to present multiple screens and entry points.
// Instantiate the pairing SDK
let pairing = NamiPairing(
baseURL: baseUrl,
tokenStore: tokenStore,
threadSecureStorage: KeychainThreadDatasetStorage.self
)Define the appearance, language, server environments, and client settings using NamiSdkConfig. This configuration is heavily utilized by the Server-Driven UI (SDUI) engine to fetch the correct layout templates.
let config = NamiSdkConfig(
baseURL: URL(string: "https://mobile-screens.nami.surf/divkit/v0.2.0/precompiled_layouts")!,
countryCode: "us",
measurementSystem: .imperial,
clientId: "alarm_com_security",
language: "en-US",
appearance: .light
)To start a flow, provide the configuration and call presentEntryPoint on your pairing instance.
// Present the template
pairing.presentEntryPoint(
entrypoint: .setupKitGuide,
config: config,
pairingSteps: ViewsContainer()
).settings- Presents the device/system settings screen..setupKitGuide- Presents the guided flow for setting up a complete kit of devices..setupDeviceGuide- Presents the flow for setting up a single device.