Nx10 Logo
Docs

Architecture & Setup

Understanding iOS Keyboard Extensions, Sandboxing, and App Groups.

The Extension Ecosystem

Integrating the Nx10 Keyboard is fundamentally different from a standard SDK. In iOS, a custom keyboard does not run inside your main app. It is a completely separate binary (an App Extension) that the OS runs on your behalf in a strictly isolated memory sandbox.

1. The Host App

iOS SDK

Your primary iOS application. The host app acts as the "setup wizard" and communication hub. It logs the user in, gathers their identifiers (Device ID, Email), requests Push Notification permissions, and writes this data to a shared vault. (This is easiest when the Host App is running the Nx10 iOS SDK).

2. The Keyboard Extension

The isolated keyboard process. It wakes up whenever the user focuses a text field in any app. It reads the credentials from the shared vault, tracks kinematics, and securely sends telemetry to the LFM.

Xcode Setup Requirements

1. Add the Target

In Xcode, go to File > New > Target and select Custom Keyboard Extension. Name it something like MyCompanyKeyboard.

2. Configure App Groups (Crucial)

Because the Host App and the Keyboard Extension run in different sandboxes, they cannot share variables. You must enable the App Groups capability in Xcode for both targets. Assign them a shared group identifier (e.g., group.com.mycompany.nx10). This creates a secure, shared UserDefaults vault where the Host App can pass the Nx10 API key and User Identifiers down to the keyboard.

3. RequestsOpenAccess

In your Keyboard Extension's Info.plist, under NSExtension > NSExtensionAttributes, you must set RequestsOpenAccess to YES. Without this, iOS will completely block the keyboard from making the network requests required to send telemetry to the LFM.